in web application, i am trying to declare property, i found in some of blogs that they declare property like this :
public System.Nullable<DateTime> LoginDateTime { get; set; }
what is the meaning of the above property.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is called an auto-implemented property.
The compiler will transform this code into something like:
The “generated” code is then called a property:
About System.Nullable<>
Value type cannot have a null value (compared to reference types). The use of
System.Nullable<>allows representing the correct range of values for its underlying value type, plus an additional null value.Another notation to
System.Nullable<DateTime>isDateTime?Nullable Types (C# Programming Guide)