O'Reilly logo

Fluent Entity Framework by Rebecca M. Riordan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required