title: Sort objects in List by properties on the object
body: <p>I have a List of objects in C#. All the objects contain properties code1 and code2 (among other properties). The list of objects is in no particular order.
  I need to sort the list of objects by their code1 and code2 properties.</p>
  
  <p>Example:</p>
  
  <pre><code>List -&gt; object = id, name, code1, code2, hours, amount.
  </code></pre>
  
  <p>Example code 1 = 004<br>
  Example code 2 = 001, 002, 003, 004, 016<br>
  Example code 1 = 005<br>
  Example code 2 = 001, 002, 003, 004  </p>
  
  <p>So after the sort I would want the objects in the following order</p>
  
  <pre><code>004 001
  004 002
  004 003
  004 005
  004 016
  005 001
  005 002
  005 003
  005 004
  </code></pre>