title: CRM 2011 LINQ: Invalid ‘where’ condition. An entity member is invoking an invalid property or method
body: <p>I am running the following LINQ query but it's throwing an error saying "Invalid ‘where’ condition. An entity member is invoking an invalid property or method."</p>
  
  <p>Can anyone suggest me why it's happening. If I remove the <code>conn.Record2Id.LogicalName.Equals("account")</code> from <code>WHERE</code> it returns the result but I can see LogicalName = account in <code>quick view</code>.</p>
  
  <pre><code>var connections = (from conn in context.CreateQuery&lt;Connection&gt;()                              
                    where (conn.Record1Id.Id.Equals(incidentId) 
                    &amp;&amp; conn.Record2Id.LogicalName.Equals("account") 
                    &amp;&amp; conn.StateCode == 0)
                    select conn).FirstOrDefault();
  </code></pre>
  
  <p>Thanks in Advance</p>