title: Entity Framework group by and get max
body: <p>Lets say I've table with the structure as below:</p>
  
  <p><code>MyRow:</code></p>
  
  <pre><code>Id Name Date
  1  A    2015/01/01
  2  B    2015/01/01
  3  C    2015/01/02
  4  A    2015/01/03
  5  B    2015/01/03
  6  A    2015/01/02
  7  C    2015/01/01
  </code></pre>
  
  <p>Using EF I would like to get list of MyRow which would contain elements with distinct names and newest date so in this case it would be:</p>
  
  <pre><code>4 A 2015/01/03
  5 B 2015/01/03
  3 C 2015/01/02
  </code></pre>
  
  <p>I started with something like this:</p>
  
  <pre><code>var myRows = context.MyRows.GroupBy(mr =&gt; mr.Name).Select(..now wth with max..)
  </code></pre>