title: How to map a stored procedure result to a custom class?
body: <p>I am using <code>entity framework 5</code> and I've added two stored procedures to my <code>.edmx</code> model.</p>
  
  <p>The first stored procedure returns a string and if I open the model browser in Visual Studio, I can change the <code>Returns a Collection Of</code> section and set the scalar type to String, as follows:</p>
  
  <p><a href="https://i.stack.imgur.com/mbv3Z.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mbv3Z.png" alt="ScalarType"></a></p>
  
  <p>Then in the code, I can call the SP and get the result like follows:</p>
  
  <pre><code>using (var context = new MyEntities())
  {
      var spResult = context.mySPNameFromTheModel(exampleParameter1, exampleParameter2); // This will get the output as string
  }
  </code></pre>
  
  <p>The above example works fine, but how can I do the same with a Complex type? </p>
  
  <p>My second stored procedure returns just one row, with two columns, both strings. So I created a class with two string properties, but I cannot see it when I change to Complex, I cannot select anything from the drop down because it is empty.
  <a href="https://i.stack.imgur.com/HWAvr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HWAvr.png" alt="ComplexType"></a></p>
  
  <p>When I click on <code>Get Column Information</code>, it just says that the SP doesn't return any columns, which isn't true.</p>