title: Cannot implicitly convert type 'object' to 'System.Web.Mvc.ActionResult'. MVC using stored procedure
body: <p>My ASP.NET MVC application uses a stored procedure that returns an object like this:</p>
  
  <pre><code>public virtual ObjectResult&lt;SP_DatabaseFirst_Result&gt; SP_DatabaseFirst()
  {
      return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction&lt;SP_DatabaseFirst_Result&gt;("SP_DatabaseFirst");
  }
  </code></pre>
  
  <p>And I have a document repository class and that is filtering the results of the stored procedures output:</p>
  
  <pre><code>public IEnumerable&lt;SP_DatabaseFirst_Result&gt; GetAllOfficeStaff() 
  {
      return  DocumentDb.SP_DatabaseFirst().Select(s =&gt; s).OrderBy(s =&gt; s.sName);
  }
  </code></pre>
  
  <p>Finally I am trying to return ViewData from my controller as an <code>ActionResult</code>:</p>
  
  <pre><code>public ActionResult Index() {
  
          return ViewData["MyData"]= DocumentDd.GetAllOfficeStaff();
  }
  </code></pre>
  
  <p>However, I get an error: </p>
  
  <blockquote>
    <p>Cannot implicitly convert type 'object' to 'System.Web.Mvc.ActionResult'. An explicit conversion exists (are you missing a cast?)</p>
  </blockquote>