?
makes a value type (int
, bool
, DateTime
, or any other struct
or enum
) nullable via the System.Nullable<T>
type. DateTime?
means that the variable is a System.Nullable<DateTime>
. You can assign a DateTime
or the value null
to that variable. To check if the variable has a value, use the HasValue
property and to get the actual value, use the Value
property.