title: multiple group into in single linq query
body: <p>I believe I need to have multiple "Group into" statements in a single linq query.  Here is what I am trying to do:</p>
  
  <pre><code>var queryNew = from a in ICDUnitOfWork.AlphaGroups.Find()
                 join e in ICDUnitOfWork.Alphas.Find()
                        on a.AlphaGroupID equals e.AlphaGroupID into g
                 join c in ICDUnitOfWork.Codes.Find()
                        on a.CodeID equals c.CodeID into co
                 join cod in ICDUnitOfWork.Codes.Find()
                          on g.CodeID equals cod.CodeID
                 select new HomeSearchViewModel
                 {
                     Alphas = g,
                     AlphaGroups = a,
                     AlphaGroupCode = co,
                     AlphasCodes = cod
                 };
  </code></pre>
  
  <p>An alpha group has an collection of Alphas.  Each AlphaGroup has a corresponding AlphaGroup.CodeId, an each Alpha has an Alpha.CodeId that needs to join with the 'Codes" class.  I'm not sure how to adjust my query to accomplish this. </p>
  
  <p><strong>Edit:</strong>  the final result should look something like:</p>
  
  <p>AlphaGroup -> contains Multiple "Alphas" </p>
  
  <p>Each AlphaGroup  has a corresponding CodeId from the "Codes" class, and each Alpha also has a corresponding CodeID.  </p>
  
  <p>So the ViewModel looks like:</p>
  
  <pre><code>public class HomeSearchViewModel
  {
      public IEnumerable&lt;Alpha&gt; Alphas { get; set; }
      public AlphaGroup AlphaGroups { get; set; }
      public IEnumerable&lt;Code&gt; AlphasCodes { get; set; }
      public Code AlphaGroupCode { get; set; }
      public string SearchTerm { get; set; }
  }
  </code></pre>