title: Assigning `null` value to Nullable<DateTime> with single line 'if'
body: <p>I have a Class like this</p>
  
  <pre><code>public class MyClass
  {
      public int Id { get; set; }
      public Nullable&lt;DateTime&gt; ApplicationDate { get; set; }
      ....
  }
  </code></pre>
  
  <p>Now I'm trying to fill an object of <code>MyClass</code> like this</p>
  
  <pre><code>DataTable dt = DBHelper.GetDataTable(sql, conn);
  DataRow dr = dt.Rows[0];
  
  MyClass oMyClass = new MyClass();
  oMyClass.Id = (int)dr["Id"];
  oMyClass.ApplicationDate = dr["ApplDate"] == DBNull.Value ? null : Convert.ToDateTime(dr["AppDate"]); 
  //Above line gives an error
  ....
  </code></pre>
  
  <p>Assigning of Application Date value gives an error</p>
  
  <p><code>Type of conditional expression cannot be determined because there is no implicit conversion between '&lt;null&gt;' and 'System.DateTime'</code>    </p>
  
  <p>What am I missing here?</p>