title: How do I make an EF-Core (2.1) Compiled Query return an IQueryable?
body: <p>I've been trying to convert a query that gets executed a lot in my application to a compiled query, with no success. I've boiled it down to a simple query so have concluded that I must be misunderstanding how something works.</p>
  
  <p>Here is the simple example query without using compile query (this works):</p>
  
  <pre><code>private static Func&lt;Entities, int, string, IQueryable&lt;Users&gt;&gt; _getUsers =
      (Entities context) =&gt;
          from au in context.Users select au;
  </code></pre>
  
  <p>Once I add the compile query call:</p>
  
  <pre><code>private static Func&lt;Entities, int, string, IQueryable&lt;Users&gt;&gt; _getUsers =
      EF.CompileQuery((Entities context) =&gt;
          from au in context.Users select au);
  </code></pre>
  
  <p>I get this exception:</p>
  
  <blockquote>
    <p>Cannot implicitly convert type 'System.Func>' to 'System.Func>'. An explicit conversion exists (are you missing a cast?)</p>
  </blockquote>
  
  <p>For the life of me, I can't figure out what I'm doing wrong...any suggestions?</p>