title: How to find duplicate items based on multiple values using LINQ?
body: <p>Suppose I have the following class:</p>
  
  <pre><code>public class Test{
      public string Length { get; set; }
      public string Width { get; set; }
      public string Height { get; set; }
      public int Count { get; set; }
      public string Label { get; set; }
  }
  </code></pre>
  
  <p>And I would like to find items that have the same value for length and label and counting how many there are for each. So far my code looks like:</p>
  
  <pre><code>var dups = testlist.GroupBy(i =&gt; new { i.Length, i.Label })
                     .Where(g =&gt; g.Count() &gt;= 1)
                     .Select(g =&gt; new { Length = g.Key.Length, Label = g.Key.Label, 
                                        Count = g.Count() });
  </code></pre>
  
  <p>But the problem is, the objects in var no longer have the width or height property (they don't exist in g.Key). Is there anyway to find duplicates based on two properties while saving other properties in the result?</p>