I want to create a property that could able to distingush between value and no value.
i.e. for example property should be able to distingush between 0 and No value.
any pointers will be helpful.
How to distingush between value and no value of Property
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.


Abhishek JainRank #1,062 · 1.8K reputationPosted Sep 16, 2013, 9:29 PM EDT
int? test;
Now you can test it for Nullable values by checking\
test.HasValue
Its a boolean property which returns true and false so if the variable does not contain any value it will be false else true.
And to retrieve the value you can do this:
test.Value
Regards
AJ