Monday, March 30, 2009

? used with types in C#

A value type with a question mark at the end indicates it is Nullable.

Example:

public DateTime? Start Date
{
    get { }
    set { }
}

This helps with interactions with SQL Server, which can allow null values in columns.

No comments:

Post a Comment