title: C# Linq -Extension Method
body: <p>How to use extension methods to form the second query as the first one.</p>
  
  <pre><code>1) var query = from cm in cust
                 group cm by cm.Customer into cmr
                 select (new { CKey = cmr.Key, Count = cmr.Count() });
  </code></pre>
  
  <p><strong>(second query is not well formed)</strong></p>
  
  <pre><code>2)    var qry = cust.GroupBy(p =&gt; p.Customer).
                  Select(new { CKey = p.Key, Count = p.Count }); 
  </code></pre>