Grouping list element in C#
<p>I have the following list: </p>

<pre><code>List&lt;string&gt; data = new List&lt;string&gt;();
</code></pre>

<p>Then I populate it by fetching the result of a MySQL request: </p>

<pre><code>data.Add(name);
</code></pre>

<p>The list is well populated but I would like to make a grouping, and would like to get the number of each name present in the list: </p>

<pre>
name A = X;
name B = X; 
etc...
</pre>

<p>I tried to do it using <code>data.GroupBy(data, data.Count)</code> but did not work.</p>

<p>Any suggestions?</p>
