title: How to convert complex type to actionresult
body: <p>I am new to MVC, and trying to call a stored proc from the controller.</p>
  
  <p>In the model I have edmx which has all stored procs as functions</p>
  
  <blockquote>
    <p><strong>Cannot implicitly convert type</strong>
    <code>System.Collections.Generic.IEnumerable&lt;MVC.Models.xxcomplextype_result&gt;</code>
    to <code>System.Web.Mvc.ActionResult</code><br>
    <em>An explicit conversion exists.</em></p>
  </blockquote>
  
  <p>I created an object for the entity in the controller and in an action result function I called the function calling the stored proc and it returned the above error.
  How should I convert the result set to actionresult?</p>
  
  <p><strong>Code Sample</strong></p>
  
  <pre><code>public class DBController : Controller
  {
      XXXXXXXEntities xXXXXXEntities = new XXXXXXXEntities();
  
      public IEnumerable&lt;usp_xxxxx_Result&gt; usp_xxxxx()
      {
          return XXXXXEntities.usp_xxxxx();
      }
  }
  
  public ActionResult ViewQuery() {
      DBController dBController = new DBController();
  
      return dBController.usp_xxxxx();
  }
  </code></pre>