title: Unable to create a constant value of type . Only primitive types or enumeration types are supported in this context
body: <p>I have the following method for a generic check exist,</p>
  
  <pre><code>public virtual bool CheckExist(T entity)
  {
      var context = new eTRdataEntities();
      IQueryable&lt;T&gt; dbQuery = context.Set&lt;T&gt;();
      if (dbQuery.Any(e =&gt; e == entity))
      {
          return true;
      }
      return false;
   }
  </code></pre>
  
  <p>However it returns the exception:</p>
  
  <p>Unable to create a constant value of type . Only primitive types or enumeration types are supported in this context.</p>
  
  <p>Please advice,</p>
  
  <p>Many Thanks,</p>