title: Sorting a List of Custom Objects
body: <p>I have a class called Person which contains a property LastName, which reflects a string cooresponding to the Person's last name.</p>
  
  <p>I created a List as follows:</p>
  
  <pre><code>var People = List&lt;Person&gt;
  </code></pre>
  
  <p>What I would like to do is sort the people by their LastName property in alphabetical order.</p>
  
  <p>After looking at some examples, I've tried</p>
  
  <pre><code>People = People.OrderBy(p =&gt; p.LastName);
  </code></pre>
  
  <p>But it does not work.</p>