title: How do you create nested groups with linq via lambda/method expressions
body: <p>Is it possible? For example, how would you rewrite the working code below with a lambda expression?</p>
  
  <pre><code>public void QueryNestedGroups()
  {
      var queryNestedGroups =
          from student in students
          group student by student.Year into newGroup1
          from newGroup2 in
              (from student in newGroup1
              group student by student.LastName)
          group newGroup2 by newGroup1.Key;
  }
  
  // Three nested foreach loops are required to iterate  
  // over all elements of a grouped group. Hover the mouse  
  // cursor over the iteration variables to see their actual type. 
  foreach (var outerGroup in queryNestedGroups)
  {
      Console.WriteLine("DataClass.Student Level = {0}", outerGroup.Key);
      foreach (var innerGroup in outerGroup)
      {
          Console.WriteLine("\tNames that begin with: {0}", innerGroup.Key);
          foreach (var innerGroupElement in innerGroup)
          {
              Console.WriteLine("\t\t{0} {1}", innerGroupElement.LastName, innerGroupElement.FirstName);
          }
      }
  }
  </code></pre>