Showing posts with label C#. Show all posts
Showing posts with label C#. Show all posts

Thursday, July 18, 2013

DateTime? and Null with the Ternary Operator

Yesterday, in a method that processes form data, I coded what I thought was a simple, concise statement to check for null input and set a DateTime? property in an MVC model to null. Well, apparently I was wrong because the compiler didn't like it at all...