Linq .GroupBy() with count
<p>I have a table that I need to summarize in a report.  This is my sample table.<br/></p>

<pre><code>                Orders
_____________________________________
CustomerId | CustomerName | OrderType 
___________|______________|__________ 
1          |     Adam     | Shoe
1          |     Adam     | Shoe
1          |     Adam     | Shoe
1          |     Adam     | Hat
1          |     Adam     | Hat
2          |     Bill     | Shoe
2          |     Bill     | Hat
3          |     Carl     | Sock
3          |     Carl     | Hat
</code></pre>

<p>I am trying to summarize this to pass back in my viewmodel without a loop.  This is the result that I am attempting to achieve.</p>

<pre><code>CustomerName | Shoe | Hat | Sock | Total Orders
------------ | ---- | --- | ---- | ------------
Adam         |   3  |  2  |  0   |      5
Bill         |   1  |  1  |  0   |      2
Carl         |   0  |  1  |  1   |      2

//var resultList = dbContext.Orders.OrderBy(o =&gt; o.CustomerId);
</code></pre>

<p>How can I use GroupBy and Count to achieve my desired results?  Would that be the best approach to take?</p>