title: Unable to create a constant value in a linq query
body: <p>Running this query:</p>
  
  <pre><code>var holderAccounts = db.AccountDetails.Include(p =&gt; p.BranchDetail)
                 .Where(p =&gt; holder.AccountDetails.Any(a =&gt; a.Id == p.Id));
  </code></pre>
  
  <p>I get this exception:</p>
  
  <blockquote>
    <p>Unable to create a constant value of type 'CodeFirst.AccountDetail'. Only primitive types or enumeration types are supported in this context.</p>
  </blockquote>
  
  <p>Relationships are:</p>
  
  <pre><code> AccountHolder 1 to many AccountDetail 1 to 1 BranchDetail
  </code></pre>
  
  <p>What am I doing wrong?</p>