Thursday, 1 September 2011

When is a DateTime? not a DateTime

Interesting fact I just discovered about Nullable<DateTime> (i.e. DateTime? objects) today, is that when you type check it against a non nullable version i.e. System.DateTime, then it will be classed as a DateTime type if the nullable DateTime? has a value.

E.g.

image

image

No comments:

Post a Comment