title: EF can't infer return schema from Stored Procedure selecting from a #temp table
body: <p>Suppose the following:</p>
  
  <pre><code>CREATE PROCEDURE [MySPROC]
  AS 
  BEGIN
  
  CREATE TABLE #tempSubset(
      [MyPrimaryKey] [bigint]  NOT NULL,
      [OtherColumn]  [int]     NOT NULL)
  
  INSERT INTO #tempSubset (MyPrimaryKey, OtherColumn) 
      SELECT SomePrimaryKey, SomeColumn 
      FROM   SomeHugeTable
      WHERE  LimitingCondition = true
  
  SELECT MyPrimaryKey, OtherColumn 
  FROM   #tempSubset
  WHERE  SomeExpensiveCondition = true
  
  END
  </code></pre>
  
  <p>When I generate a function import or map a return type, EF doesn't generate a complex type or tells me: </p>
  
  <blockquote>
    <p>The selected stored procedure or function returns no columns</p>
  </blockquote>
  
  <p>How to overcome this?</p>
  
  <p>Other answers suggest <a href="https://stackoverflow.com/questions/14545698/using-stored-procedure-in-entity-framework-5-with-complex-type">using table variables</a> (not going to do this for performance reasons) <a href="https://stackoverflow.com/a/3402669/237723">faking the return schema and commenting out the real stored procedure</a>, other suggest <a href="https://stackoverflow.com/a/5326607/237723">doing similar with views</a>... but there must be a way to do this without having to add unnecessary overhead or requiring me to break a stored procedure to update the model?</p>