title: Understanding Multiple Tables result under Entity Framework
body: <p>In order to show a page I need to grab a lot information from various tables, and for now, it takes around 20 seconds to load the page, witch is terrible.</p>
  
  <p>So I want to move everything into one Store Procedure and get all that info the old DataTable way.</p>
  
  <p>I get this</p>
  
  <pre><code>public WinnerPageInformation FindWinnerPageInformation(int calendarId)
  {
      BackendPagesContext ctx = new BackendPagesContext(db.Connection);
      IMultipleResults results = ctx.WinnersBackendPageInformation(calendarId);
  
      return new WinnerPageInformation()
      {
          Challenges = results.GetResult&lt;Challenges&gt;(),
          Content = results.GetResult&lt;ContentWinners&gt;().FirstOrDefault(),
          Einfo = results.GetResult&lt;ContentEmails&gt;().FirstOrDefault(),
          Fields = results.GetResult&lt;SubscriberFields&gt;(),
          Prizes = results.GetResult&lt;Prizes&gt;(),
          Winners = results.GetResult&lt;Winners&gt;()
      };
  }
  </code></pre>
  
  <p>and WinnersBackendPageInformation looks like this</p>
  
  <pre><code>public class BackendPagesContext : DataContext
  {
      public BackendPagesContext(System.Data.IDbConnection connection) 
          : base(connection) { }
  
      [Function(Name = "dbo.sp_GetWinnersBackendPageInformation")]
      [ResultType(typeof(JK_ContentWinners))]
      [ResultType(typeof(JK_Winners))]
      [ResultType(typeof(JK_SubscriberFields))]
      [ResultType(typeof(JK_Prizes))]
      [ResultType(typeof(JK_Challenges))]
      [ResultType(typeof(JK_ContentEmails))]
      public IMultipleResults WinnersBackendPageInformation(
          [Parameter(Name = "calendarId", DbType = "Int")] int calendarId)
      {
          IExecuteResult result =
          this.ExecuteMethodCall(this,
                                 ((MethodInfo)(MethodInfo.GetCurrentMethod())),
                                 calendarId);
          return (IMultipleResults)(result.ReturnValue);
      }
  }
  
  public interface IMultipleResults : IFunctionResult, IDisposable
  {
      IEnumerable&lt;TElement&gt; GetResult&lt;TElement&gt;();
  }
  </code></pre>
  
  <p>but the problem I'm facing is that, the line <code>this.ExecuteMethodCall</code> throws an error saying that the result is not a MultipleTable result.</p>
  
  <p>my Store Procedure looks like</p>
  
  <pre><code>ALTER PROCEDURE sp_GetWinnersBackendPageInformation
      @calendarId numeric = 0
  AS
  BEGIN 
      SELECT * FROM ContentWinners WHERE calendar_id = @calendarId;
      SELECT * FROM Winners WHERE calendar_id = @calendarId;
      SELECT * FROM SubscriberFields WHERE calendar_id = @calendarId ORDER BY position;
      SELECT * FROM Prizes WHERE calendar_id = @calendarId ORDER BY prizetype_id, to_day, title;
      SELECT * FROM Challenges WHERE calendar_id = @calendarId;
      SELECT * FROM ContentEmails WHERE calendar_id = @calendarId;
  END
  GO
  </code></pre>
  
  <p>Error message is</p>
  
  <blockquote>
    <p>More than one result type declared for function 'WinnersBackendPageInformation' that does not return IMultipleResults.</p>
  </blockquote>
  
  <p>What am I missing?</p>