title: how to sortby a given value a generic type list
body: <p>What I am trying to do is this code </p>
  
  <pre><code>filtered = GetUserList().OrderBy(p =&gt; p.Name).ToList();
  </code></pre>
  
  <p>in a generic way </p>
  
  <pre><code>public static List&lt;T&gt; sortBy&lt;T&gt;(string field, List&lt;T&gt;list)
  {
      //list.OrderBy(p=&gt;p.Equals(field)).ToList();
      //list = list.OrderBy(p =&gt; p.GetType().GetProperties().ToList().Find(d =&gt; d.Name.Equals(field))).ToList();
      return list;
  }
  </code></pre>
  
  <p>any suggestions?</p>