title: Mapping multiple result sets stored procedure in EF 5 or EF 6 CodeFirst
body: <p>I have a entity model as below:</p>
  
  <pre><code>public Entity
  {
      //Properties
  }
  
  public Activity : Entity
  {
      //Properties
      public Action Action { get; set; }
      public ICollection&lt;Command&gt; Commands { get; set; }
  }
  
  public Action : Entity
  {
      //Properties
  }
  
  public Command : Entity
  {
      //Properties
  }
  </code></pre>
  
  <p>I have a store procedure that returns List of Activities along with Related Actions and Commands of each Activity. How I can map the result sets of the before-mentioned store procedure in EF5  or EF 6 Codefirst ?
  I already used <code>ObjectContext.Translate</code> method of which is explained in MSDN article <a href="http://msdn.microsoft.com/en-us/data/jj691402.aspx" rel="nofollow">Stored Procedures with Multiple Result Sets</a>.</p>
  
  <p>But the problem is all my entities are derived from <code>Entity</code> class and that's why when I used 
  <code>ObjectContext.Translate</code> for <code>Activity</code> .. I can't use it for <code>Action</code> and <code>Command</code> since It maps the <code>EntitySetName</code> of the <code>Entity</code> class for <code>Activity</code>so if I use it for either <code>Action</code> or <code>Command</code> it'll raise error. How I can manage that?</p>