title: How do I get the latest date from a collection of objects using LINQ?
body: <p>I have a list of objects and each object has a  <strong>ExpirationDate</strong> property which is of type <strong>DateTime</strong>. I want to retrieve the latest date in the list. Is there an elegant way of doing that through LINQ?</p>
  
  <p>Something like:</p>
  
  <pre><code>DateTime latestDate =  myCollection.Where(r=&gt;r.ExpirationDate.HasValue).MaxDate(r=&gt;r.ExpirationDate.Value);
  </code></pre>