title: Using Linq to remove duplicate by column values based on a second column
body: <p>I have a datatable with two columns "DT" and "ASOF", both dates. There are rows has duplicate values of DT, which I find by doing: </p>
  
  <pre><code>      var duplicateGroups = dt.AsEnumerable()
                                    .GroupBy(row =&gt; row.Field&lt;SqlDateTime&gt;("DT"))
                                    .Where(g =&gt; g.Count() &gt; 1);
  </code></pre>
  
  <p>But there is another column, "ASOF" that I want to get rid of one of the duplicate DTs based on the "ASOF" value, basically what ever ASOF date is newest. </p>
  
  <p>I can think of a for loop that will be able to do this by creating an array of the duplicates, finding the newest ASOF, and then removing all others from the DB table with that value. However, I feel like Linq has some ability to be able to do that, possibly with a comparator. But I have some very basic knowledge on it. </p>
  
  <p>Any ideas? </p>