title: LINQ Multiple Group By in a List<T> then convert to List<T>
body: <p>I have the following class</p>
  
  <pre><code>public class Person
  {
    public string ID {get; set;}
    public string Name {get; set;}
    public string District {get; set;}
    public string Level {get; set;}
  }
  </code></pre>
  
  <p>Then on my function, I am writing a LINQ to group a list of Person, by District then by Level, into a new list of the same type (Person)</p>
  
  <p>I want to write it in a way that i will not use var (making it an anonymous type) and new:</p>
  
  <p>Something like</p>
  
  <pre><code>List&lt;Person&gt; persons; \\this already has values
  List&lt;Person&gt; grpByP = persons
    .GroupBy()
    .ToList&lt;Person&gt;(); \\ Linq query to group persons list by District and Level
  </code></pre>
  
  <p>I just don't know how to write the grpByP LINQ query. </p>
  
  <p><strong>UPDATE</strong>:  I want the ID and the Name be retained in the values of the grpByP variable because using anonymous type will only include the District and Level.</p>
  
  <p>Any help will be appreciated.</p>