Lets suppose i have a field with short defined getter setter like following:
public double MyDouble { get; set; }
I want to check this MyDouble value if it is set or not. i can not check like this:
if(MyDouble == null) .... else ....
Because double variables can not get null values. So how can i check this value if it is set or not? Do i have to use a second variable holding the isSet state or is there any default value for the double type?
Thanks.
System.Double is a struct (value type).
It cannot be null.
You neeed to make it nullable:
More on Nullable Types : Nullable Types (C# Programming Guide)