title: How to sort a list of objects by a specific field in C#?
body: <p>I have this class:</p>
  
  <pre><code>public class StatInfo
  {
    public string contact;
    public DateTime date;
    public string action;
  }
  </code></pre>
  
  <p>then I have a list of StatInfo, but I'm not sure how to sort it according to the date field. Should I use the sort method? Should I create my own?</p>
  
  <pre><code>var _allStatInfo = new List&lt;StatInfo&gt;();
  // adding lots of stuff in it
  _allStatInfo.SortByDate???
  </code></pre>
  
  <p>What is the best way of doing this without having to write tons of code (if possible)?</p>
  
  <p>Thanks</p>