title: create a generic method that sorts List<T> collections
body: <p>What I used to do is create a case switch that sorts my LINQ in this format:</p>
  
  <pre><code>List&lt;products&gt; productList = GetAllLists();
  
  switch (sortBy)
  {
    case "name":
       return productsList.OrderBy(pl =&gt; pl.Name);
    case "date":
       return productsList.OrderBy(pl =&gt; pl.DateCreate);
  }
  </code></pre>
  
  <p>which, in the long run, becomes cumbersome.</p>
  
  <p>I wanted to have a generic method that you simply use to sort out List collections like these and will help you toggle which property to sort by.. something like this:</p>
  
  <pre><code>return SortListCollection(productsList, Name);
  </code></pre>