title: LINQ Select and Group By
body: <p>Fairly new to LINQ and think what I'm trying to do should be easy.  I have a list of products (<code>ProductId</code>, <code>ProductDesc</code>) and I'm trying to pull a subset of that list and group it by <code>ProductId</code>.  From there, I'd like to bind that subset to a listView.  Here's the query I'm working on:</p>
  
  <pre><code>productCounts = (from record in wowReportData 
                   group record by record.ProductID 
                   into grouping
                   orderby grouping.Key
                   select new topProduct 
                   { 
                       ProductID = grouping.Key, 
                       Quantity = grouping.Count(),
                       Name = grouping.
                   }).ToList();
  </code></pre>
  
  <p>and here's the class I'm trying to populate:</p>
  
  <pre><code>public class topProduct
  {
      public string ProductID { get; set; }
      public int Quantity { get; set; }
      public string Name { get; set; }
  
      public topProduct() { }
  
      public topProduct(string productId, string productDesc, int downloadCount)
      {
          this.ProductID = productId;
          this.Name = productDesc;
          this.Quantity = downloadCount;
      }
  }
  </code></pre>
  
  <p>I had it working fine with just displaying the <code>productId</code> and the count but I need to add the description to the display as well.  I'm confused as to how to add the product description when I'm doing the grouping.</p>