title: LINQ query to group results into an array
body: <p>Given:</p>
  
  <pre><code>var detailList = new List&lt;DetailItem&gt;();
  </code></pre>
  
  <p>Where:</p>
  
  <pre><code>class DetailItem
  {
      string A;
      MyType B;
  }
  </code></pre>
  
  <p>Can a LINQ query group on field A into the following data structure:</p>
  
  <pre><code>class GroupItem
  {
      string A;
      List&lt;MyType&gt; AllBsWithinA;
  }
  
  
  
  IEnumerable&lt;GroupItem&gt; linqQuery = detailList.SomeLinqMagic(…);
  </code></pre>
  
  <p>The data in question is all memory based so this is a LINQ to Objects question.</p>