title: C# LINQ: Get count for each row
body: <p>Here the query for retrieving all the <em>comptes</em> in my base.</p>
  
  <p>I would like to add a number within the object GridCompte in order to count the element inside the list (1,2,3...):</p>
  
  <pre><code>var comptes = (from c in Comptes                           
                 join s in Societies on c.IdSoc equals s.IdSoc    
                 select new GridCompte
                 {
                     SocCompteId = c.IdCompte,                               
                     Name = c.Name,
                     Nb = ??? COUNT ???,
                     .....
                     SocName = s.Name
                 }).ToList();
  </code></pre>
  
  <p>I tried using the <strong>group</strong> statement, but i didn't manage to achieve my goal. </p>
  
  <p>Any suggestions?  </p>