I'm not sure if they answered yet, I examined a couple of questions, but I do not think that they were what I was.
Let's say I have 3 tables:
Restaurant 1.....M MenuCategory 1.....M MenuItem
I have an L2E request that looks something like this:
Restaurant = context.Restaurant
.Include(r => r.MenuCategory)
.FirstOrDefault(r => r.RestaurantId == resaurantId);
Which works to some extent, but it only preloads the menu categories.
As a job, I can iterate through each category and call them .Load (), but this will include much more, which theoretically I will need.
What I really want to do is something like:
Restaurant = context.Restaurant
.Include(r => r.MenuCategory)
.Include(r => r.MenuCategory.MenuItems)
.FirstOrDefault(r => r.RestaurantId == resaurantId);
But it is clear that this is not available as r.MenuCategory is enumerated
ANSWER 1:
context.Restaurant.Include ("MenuCategory.MenuItems");
, , , :
Entity Framework - ? - 2