title: Is it possible to set the property of the condition dynamically?
body: <p>Normally when I want for example to find the first or default item of a List I use this way:</p>
  
  <pre><code>myList.SingleOrDefault(x=&gt;x.MyPropery01 == "myCondition");
  </code></pre>
  
  <p>However, I would like to know if it is possible, for example by reflection, if I set the the property <code>MyProperty</code> dynamically, something like:</p>
  
  <pre><code>myList.SingleOrDefault(x=&gt;x.GetType().GetProperty("MyProperty01") == "myCondition");
  </code></pre>
  
  <p>Because sometimes I need to search for <code>MyProperty01</code>, sometimes for <code>MyProperty02</code>, <code>MyProperty03</code>, etc..</p>
  
  <p>EDIT: in visual studio I get this error:</p>
  
  <pre><code>"Operator '==' can't be applied to operands of type System.reflection.PropertyInfo and string".
  </code></pre>