title: C# LINQ OrderBy several clauses
body: <p>I'm currently working on an application in ASP.NET MVC 4.5. I need to write a LINQ query to order a list of Projects by different StatusIds.</p>
  
  <p>Given is a list of Projects with this ViewModel:</p>
  
  <pre><code>public class ProjectVm 
  {
     public int ProjectId { get; set; }
     public string Title { get; set; }
     public Status StatusId { get; set; }
  }
  </code></pre>
  
  <p>My project status enum:</p>
  
  <pre><code>public enum Status : byte
  {
      Draft = 1,
      Pending = 2,
      Validated = 3,
      Refused = 4
  }
  </code></pre>
  
  <p>The idea is to bring the <code>List&lt;ProjectVm&gt;</code> in a certain order, thus first ordered by <strong><em>1 Draft</em></strong>, second by <strong><em>2 Pending</em></strong>, third by <strong><em>4 Refused</em></strong> and fourth by <strong><em>3 Validated</em></strong>.</p>
  
  <p>My current query looks like this:</p>
  
  <pre><code>projects = projects.OrderBy(x =&gt; x.StatusId).ToList();
  </code></pre>
  
  <p>Unfortunately this query doesn't respect the desired order (4 comes before 3).</p>
  
  <p>Do you know how to apply a condition on this query to bring the projects into the right order (1, 2, 4, 3) ?</p>
  
  <p>Thanks!</p>