title: linq group by, order by
body: <p>I have the following list</p>
  
  <pre><code>ID  Counter  SrvID FirstName
  --  ------   ----- ---------  
  1   34       66M   James
  5   34       66M   Keith
  3   55       45Q   Jason
  2   45       75W   Mike
  4   33       77U   Will
  </code></pre>
  
  <p>What I like to do is to order by ID by ascending and then
  get the first value of Counter, SrvID which are identical (if any).</p>
  
  <p>So the output would be something like:</p>
  
  <pre><code>ID  Counter  SrvID FirstName
  --  ------   ----- ---------  
  1   34       66M   James
  2   45       75W   Mike
  3   55       45Q   Jason
  4   33       77U   Will
  </code></pre>
  
  <p>Note how ID of 5 is removed from the list as Counter and SrvID was identical to what I had for ID 1 but as ID 1 came first 
  I removed 5.</p>
  
  <p>This is what I would do but not working</p>
  
  <pre><code>    var result = (from ls in list1
                    group ts by new {ls.Counter, ls.SrvID}
                  order by ls.ID
                    select new{
                               ls.ID,
                               ls.Counter.FirstOrDefault(),
                               ls.SrvID.First,
                               ls.FirstName}).ToList()
  </code></pre>