title: Calling stored procedure in EF with Complex Data Type
body: <p>I am new to working with <code>Entity Framework</code> in a sample <code>ASP.NET/MVC 3.0 VS2010</code> project. I have imported two stored procedures as Function Imports and, in doing so, created a complex data type for each.</p>
  
  <p>I am trying to run the following c# code:</p>
  
  <pre><code>public ComplexDataType RunStoredProc()
  {
      var context = new DbEntities();
      int param1 = 370;
      int param2 = -1;
      string param3 = "Current";
  
      ComplexDataType result = new ComplexDataType;
      result = context.StoredProc(param1, param2, param3);
      return result;
  }
  </code></pre>
  
  <p>And I'm getting the error:</p>
  
  <pre><code>Cannot implicitly convert data type 
      System.Data.Objects.ObjectResult(ComplexDataType) to 'ComplexDataType'
  </code></pre>
  
  <p>What am I doing wrong? How do I properly store the results of the stored proc in a complex data type?</p>