title: The type Parameter in Execute Function is incompatible with the type returned by the function
body: <p>I'm getting the following error when trying to import a stored proc as a function in Entity Framework 5. I have recently updated the data project to reference the new version of EF. </p>
  
  <blockquote>
    <p>The type parameter 'SSDS.Data.testy_Result' in ExecuteFunction is
    incompatible with the type 'SSDS.Data.testy_Result' returned by the
    function.</p>
  </blockquote>
  
  <p>I can't get it to work for any stored proc...here is my simple test one:</p>
  
  <pre><code>CREATE PROCEDURE testy
  
  AS
  BEGIN
      select 'hello' as hello
  END
  GO
  </code></pre>
  
  <p>It breaks with the exception above here:</p>
  
  <pre><code> public virtual ObjectResult&lt;testy_Result&gt; testy()
      {
          return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction&lt;testy_Result&gt;("testy");
      }
  </code></pre>
  
  <p>And there is no error when I set the result to a string scalar in the Edit Function Import window in the model designer. </p>
  
  <p>I'm calling the function like this:</p>
  
  <pre><code>private Entities db = new Entities();
  var x = db.testy();
  </code></pre>
  
  <p>Is there something obvious that I'm missing here? There are a few edmx files in my project and the others were created with an older version of EF (and use ObjectContext).  </p>
  
  <p>Function Mappings: </p>
  
  <p><img src="https://i.stack.imgur.com/bvLE5.png" alt="enter image description here"></p>
  
  <p>More Function Mappings Detail: </p>
  
  <p><img src="https://i.stack.imgur.com/3m8ZE.png" alt="enter image description here"></p>
  
  <p>testy_Result class:</p>
  
  <pre><code>  public partial class testy_Result
      {
          public string hello { get; set; }
      }
  </code></pre>