I have a entity model as below:
public Entity
{
//Properties
}
public Activity : Entity
{
//Properties
public Action Action { get; set; }
public ICollection<Command> Commands { get; set; }
}
public Action : Entity
{
//Properties
}
public Command : Entity
{
//Properties
}
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 ObjectContext.Translate method of which is explained in MSDN article Stored Procedures with Multiple Result Sets.
But the problem is all my entities are derived from Entity class and that's why when I used
ObjectContext.Translate for Activity .. I can't use it for Action and Command since It maps the EntitySetName of the Entity class for Activityso if I use it for either Action or Command it'll raise error. How I can manage that?