title: LINQ to Entities does not recognize the method 'System.Object GetValue(...)'
body: <p>My issue is I need to query on the value of a property in a generic class. The property is tagged with an attribute.</p>
  
  <p>See the following code:</p>
  
  <pre><code> var rowKeyProperty = EFUtil.GetClassPropertyForRowKey&lt;T&gt;();
   var tenantKeyProperty = EFUtil.GetClassPropertyForTenantKey&lt;T&gt;();
  
   var queryResult =
                  objContext.CreateObjectSet&lt;T&gt;().Single(l =&gt; (((int) tenantKeyProperty.GetValue(l, null)) == tenantKey) &amp;&amp;
                                                              (((int)rowKeyProperty.GetValue(l, null)) == KeyValue));
  </code></pre>
  
  <p>The rowKeyProperty and tenantKeyProperty are of type System.Reflection.PropertyInfo.</p>
  
  <p>I understand why I am getting the error. When the linq query is translated to SQL, it can't understand the property.GetValue.</p>
  
  <p>However, I'm completely stumped as to a work around here. Does anyone have any ideas how to achieve this? Thx.</p>