title: C# how to filter a list by different properties at runtime
body: <p>Im pretty new to C#/Unity so forgive me.</p>
  
  <p>Im writing a filtering system which will filter a list by any of the properties of the class at runtime.
  Im planning on that building up some kind of whereclause to filter the lists (i know i could hit the server to get the list i need, but currently want to just filter the data i already have)</p>
  
  <p>Say i have a list of class "MyClass" with 4 properties: "param1".."param4"</p>
  
  <p>If i wanted to filter it normally by param1 and param2 i could do:</p>
  
  <pre><code>List&lt;MyClass&gt; myList = new List&lt;MyClass&gt;(existinglist);
  myList = myList.Where(g =&gt; g.param1 == somevalue &amp;&amp; g.param2 == someothervalue).ToList();
  </code></pre>
  
  <p>How could i generate the same where clause at runtime?</p>
  
  <p>Thank you!</p>