title: How do I perform a linq GroupBy across 3+ columns
body: <p>I start off with the following list</p>
  
  <pre><code>List items = new List();
  
  items.add(new Vehicle { MakeID = 1, MakeName = "Oldsmobile", ModelID = 2, ModelName =   "98 Regency" });
  
  items.add(new Vehicle { MakeID = 1, MakeName = "Oldsmobile", ModelID = 3, ModelName = "88 Delta" });
  
  items.add(new Vehicle { MakeID = 1, MakeName = "Oldsmobile", ModelID = 4, ModelName = "Alero" });
  
  items.add(new Vehicle { MakeID = 1, MakeName = "Oldsmobile", ModelID = 5, ModelName = "442" });
  
  items.add(new Vehicle { MakeID = 2, MakeName = "Buick", ModelID = 11, ModelName = "Skylark" });
  
  items.add(new Vehicle { MakeID = 2, MakeName = "Buick", ModelID = 13, ModelName = "Electra 225" });
  
  items.add(new Vehicle { MakeID = 2, MakeName = "Buick", ModelID = 14, ModelName = "Regal" });
  
  items.add(new Vehicle { MakeID = 2, MakeName = "Buick", ModelID = 16, ModelName = "Enclave" });
  </code></pre>
  
  <p>But would like it converted to the following format:</p>
  
  <pre><code>List newList = new List();
  
  items.add(new VehicleWithModelList { MakeID = 1, MakeName = "Oldsmobile", new List&lt;Model&gt; () { This list would contain the 4 oldsmobile models from above}});
  
  items.add(new VehicleWithModelList { MakeID = 2, MakeName = "Buick", new List&lt;Model&gt; () { This list would contain the 4 buick models from above}});
  
  public class Model {
      public int ModelID { get; set; }
      public string ModelName { get; set; }
  }
  </code></pre>
  
  <p>I have the following linq to object query but I keep getting syntax errors stating it expects a semicolon before the last close parenthesis.</p>
  
  <pre><code>var newList = items.GroupBy(x =&gt; new {x.MakeID, x.ModelID, x.MakeName, x.ModelName}, (key, group) =&gt; new { MakeID = key.MakeID, MakeName = key.MakeName, ModelList = group.Select(z =&gt; new Model { ModelID = z.ModelID, ModelName = z.ModelName })).Cast&lt; VehicleWithModelList &gt;();
  </code></pre>
  
  <p>What would be the correct way to accomplish this?</p>