title: Entity Framework 6 Compiled LINQ Query
body: <p>I'm trying to improve performance of a web application by caching a query.</p>
  
  <pre><code>    public static Func&lt;myEntity, List&lt;HASHDuplicates&gt;, IQueryable&lt;FormResponse&gt;&gt; CompiledDuplicatedResponses =
      CompiledQuery.Compile&lt;myEntity, List&lt;HASHDuplicates&gt;, IQueryable&lt;FormResponse&gt;&gt;(
      (db, hashes) =&gt; from r in db.FormResponse
                      from h in db.IndexHASHes
                      from d in hashes
                      where r.id == h.FormResponseID &amp;&amp; h.IndexHASHString == d.hash
                      select r);
  </code></pre>
  
  <p>The error I receive is at compile time:</p>
  
  <p><strong>The type 'myEntity' cannot be used as type parameter 'TArg0' in the generic type or method 'System.Data.Entity.Core.Objects.CompiledQuery.Compile(System.Linq.Expressions.Expression>)'. There is no implicit reference conversion from 'myEntity' to 'System.Data.Entity.Core.Objects.ObjectContext'.</strong></p>
  
  <p>I'm using EF6</p>