title: Execute Function in IQueryable
body: <p>Using Linq, it is easy to execute a function to project an IEnumerable.</p>
  
  <pre><code>var orders = new List&lt;Order&gt;();
  orders.Where(x =&gt; x.Id &gt; 50).Select(x =&gt; new SomethingElse(x.Name));
  </code></pre>
  
  <p>Using EntityFramework and IQueryable, this is not possible. You instead get an unsupported exception at runtime because you cannot have a function inside the Select.</p>
  
  <blockquote>
    <p>Does not work:</p>
  
  <pre><code>var db = new Order();
  db.MyEntities.Where(x =&gt; x.Id &gt; 50).Select(x =&gt; new SomethingElse(x.Name)).Take(10);
  </code></pre>
  </blockquote>
  
  <p><strong>Does there exist, or is it possible to create a way for the above to work?</strong></p>
  
  <p>I understand it doesn't work because it cannot convert the function into something SQL can understand, however, if there was an extension method called 'Execute' that could execute in memory after executing all the linq before and after it, would that work?</p>
  
  <blockquote>
    <p>The database would pull only > 50 AND only TOP 10, only after would it be </p>
  
  <pre><code>var db = new Order();
  db.MyEntities.Where(x =&gt; x.Id &gt; 50).Execute(x =&gt; new SomethingElse(x.Name)).Take(10);
  </code></pre>
  </blockquote>
  
  <p><strong>To clarify: The requirement is to keep it as IQueryable even after the Sleect()</strong></p>