title: Issue with setting a DateTime? to null using ternary operator
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2815033/type-result-with-conditional-operator-in-c">Type result with conditional operator in C#</a>  </p>
  </blockquote>
  
  
  
  <p>I was just working on an a pop-up for modifying a user, when I ran into the following issue while attempting to modify the user's Date of Death :</p>
  
  <p>In this scenario, the property <code>Death</code> for the user is a <code>DateTime?</code> (Nullable Date Time).</p>
  
  <pre><code>user.Death = (model.Death != null) ? DateTime.Parse(model.Death) : null;
  </code></pre>
  
  <p>So I figured that I would be able to simply check if the value contained in the model (model.Death is a <code>string</code>) contained a value, I would set the date that value, otherwise I would set it to null, as demonstrated above.</p>
  
  <p>However, I was unable to use this syntax, as it would not allow me to explicitly set <code>user.Death</code> to null, using the ternary operator, although <code>user.Death = null</code> worked just fine. </p>
  
  <p><strong>Solution used :</strong> </p>
  
  <p>Replaced <code>: null</code> with <code>: new Nullable&lt;DateTime&gt;()</code></p>
  
  <p><strong>I guess I am just wondering, why was I unable to explicitly set a Nullable DateTime property to null using a ternary operator?</strong></p>