title: Sort a List by a property and then by another
body: <p>I have an example class containing two data points:</p>
  
  <pre><code>public enum Sort { First, Second, Third, Fourth }
  public class MyClass
  {
      public MyClass(Sort sort, string name) { 
          this.Sort = sort; 
          this.Name = name; 
      }
  
      public Sort Sort { get; set; }
      public string Name { get; set; }
  }
  </code></pre>
  
  <p>I'm looking to sort them into groups by their <code>Sort</code> property, and then alphabetize those groups.</p>
  
  <pre><code>List&lt;MyClass&gt; list = new List&lt;MyClass&gt;() { 
      new MyClass(MyClass.Sort.Third, "B"), 
      new MyClass(MyClass.Sort.First, "D"),
      new MyClass(MyClass.Sort.First, "A"),
      new MyClass(MyClass.Sort.Fourth, "C"),
      new MyClass(MyClass.Sort.First, "AB"),
      new MyClass(MyClass.Sort.Second, "Z"),
  };
  </code></pre>
  
  <p>The output would then be:
  (showing <code>Name</code>)</p>
  
  <pre><code>A
  AB
  D
  Z
  B
  C
  </code></pre>
  
  <p>I've been able to do this by using a <code>foreach</code> to separate the items into many smaller arrays (grouped by the enum value) but this seems very tedious - and I think there must be some LINQ solution that I don't know about.</p>