title: linq to get max of nullable datetime from a list
body: <p>Suppose I have a list of object models that look like this:</p>
  
  <pre><code>public class MyModel
  {
     public Nullable&lt;DateTime&gt; SomeUserTime { get; set; }
  }
  
  var List&lt;MyModel&gt; TheList = some list from somewhere
  </code></pre>
  
  <p>I want to get the latest SomeUserTime in the list, knowing that may be the list doesn't contain any value, in which case the output should be null. This is what I have:</p>
  
  <pre><code>DateTime? LatestTime = (from x in TheList select x.SomeUserTime).Max();
  </code></pre>
  
  <p>This compiles fine but the sample data doesn't have any null values. Will this also work (ie return null) if none of the elements in the list have a time?</p>
  
  <p>Thanks.</p>