Possible Duplicate:
What does the bool? return type mean?
I came a cross the following property in a class
public long? EmployeeId { get; set; }
I googled this operator with no luck, according to the MSDN MSDN OPERATOR there is only the operators ?? null-coalescing operator and ?: conditional operator.
but what about ?
In this case
?is not an operator. It is a shorter way to write:Nullable<long>T?is exactly the same asNullable<T>(withTa type)It is called a nullable type (see MSDN)
It is used to allow “non-nullable” type (like
int,long, astruct) to be assigned anullvalue.It is useful when you need a possible invalid state for a value type, or if the data is being retrieved from a database that may contain a null value.