I have a method in DAL like:
public bool GetSomeValue(int? a, int?b, int c)
{
//check a Stored Proc in DB and return true or false based on values of a, b and c
}
In this method, I am passing two nullable types, because these values can be null (and checking them as null in DB Stored Proc). I don't want to use magic numbers, so is it ok passing nullables types like this (from performance as well as architecture flexibility perspective)?
I think this is perfectly valid - I prefer nullable types to magic values also.
Since nullable types are part of the Base Class Library and not related to any specific language I find it perfectly valid. The only thing that I try to stay away from in public API's are constructs that are language-specific.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With