title: How to use Linq instead of foreach to Group and Count
body: <p>I have 2 Lists, one for Players and another for Coaches.</p>
  
  <p>To count number of Players belong to a Coach, I used:</p>
  
  <pre><code>  var g = AllePlayer.GroupBy(play=&gt; play.coachNumer);
    foreach (var grp in g)
    {
        foreach (Coach co in AlleCoaches)
        {
            if (co.coachNumer== grp.Key)
            {
                co.NumOfPlayer= grp.Count();
            }
         }
    }
  </code></pre>
  
  <p>Now I want to know if there is a nice way to put the lover parts with "foreach" in a nice Linq syntax to avoid this "foreach" loops.
  Thank you in advance!</p>