Loading related entities

If you only want to load the entities that are related to one primary entity, you can use the Load() extension method.

You can call the Load() method anywhere in your code. It doesn’t need to be in the context of a query definition:

MyRecipe.Ingredients.Load()

Master-detail is a very common scenario in data-bound applications. You present the user with a list of objects, recipes or orders, and when they select one, the application displays the details of that object. Load() is perfect for that situation.

Image Put On Your Thinking Hat

Can you rewrite that ugly snippet from the last Thinking Hat that made 6 round trips to ...

Get Fluent Entity Framework now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.