Otis wrote:
because if it would return an int, it would always return either 0 or 1, as deleteentity deletes just 1 entity.
the routines which return an int delete 1 or more entities.
I have been thinking about this a lot and that's what I thought your response would be.
However...
I think both should be uniform, returning a count/integer.
Why?
Yes, I understand that you are mapping integer to boolean; but, I don't think that mapping is necessary and I think that it confuses numeric-data with boolean-data.
As is well-known, the actual mapping of boolean to numeric can vary. In VB.NET, zero maps to False but everything else maps to True-- that is True does not just map to 1. In SQL Server, there is no actual boolean, rather we have bit, which is actually tri-state-- 1, 0, or NULL, which is not so good because it confuses matters even more.
In the current case, if BooleanFalse is meant to be zero and BooleanTrue is meant to mean 1, why not simply return an actual zero or a one?
The point is, as noted in MSDN (and probably elsewhere, and certainly as far as I am concerned), Boolean should not be used to hold a numeric value.
I don't expect you to change this; it is, perhaps, a minor point.
Regardless, I want to suggest, in a friendly way, that it should be changed.
Just a thought.
Thank you.
Reference...
I expect that most might all of this; but, I will post it for my own reference (and perhaps for others).
For SQL Server...
bit
Integer data type 1, 0, or NULL.
http://msdn2.microsoft.com/en-us/library/ms177603.aspx
For .NET...
Visual Basic Language Reference
Boolean Data Type (Visual Basic)
Holds values that can be only True or False. The keywords True and False correspond to the two states of Boolean variables.
Remarks
Use the Boolean data type to contain two-state values such as true/false, yes/no, or on/off.
The default value of Boolean is False.
Type Conversions
When Visual Basic converts numeric data type values to Boolean, 0 becomes False and all other values become True. When Visual Basic converts Boolean values to numeric types, False becomes 0 and True becomes -1.
When you convert between Boolean values and numeric data types, keep in mind that the .NET Framework conversion methods do not always produce the same results as the Visual Basic conversion keywords. This is because the Visual Basic conversion retains behavior compatible with previous versions. For more information, see Troubleshooting Data Types.
Programming Tips
Negative Numbers. Boolean is not a numeric type and cannot represent a negative value. In any case, you should not use Boolean to hold numeric values.
Type Characters. Boolean has no literal type character or identifier type character.
Framework Type. The corresponding type in the .NET Framework is the System.Boolean structure.
http://msdn2.microsoft.com/en-us/library/wts33hb3.aspx
-- Mark Kamoski