title: Intersect two generic lists by dynamic properties
body: <p>i have two generic lists with a few properties to compare but i want that the key identifiers are dynamic by a <code>List&lt;string&gt;</code>.</p>
  
  <p>So lets say we have the class:</p>
  
  <pre><code>class A
  {
      string Name { get; set; }
      string Color1 { get; set; }
      string Color2 { get; set; }
      string Length { get; set; }
  }
  </code></pre>
  
  <p>The user now can select from an user interface which properties of two lists of those objects need to overlap so that a correct pair is selected. This is stored in a <code>List&lt;string&gt;</code>. As example, if the list string contains "Name" and "Color1" there will be only objects returned where "Name" and "Color1" are overlapping.</p>
  
  <p>I was trying to write a function, but unfortunately i'm not sure which collection i should cast the generic lists to and how do i apply the names of the properties on those? If the name of the "identificators" were always the same, it wouldn't be a problem with Linq/Lambda ;)</p>
  
  <p>Thanks in advance</p>