By default, the entity framework works on a lazy load mode. this means that, if you want to load a reference, you must do it explicitly.
Imagine the scenario:

Linq example
Normally, when we make a linq query to get all the Person we would do:
Entities entities = new Entities(); var persons = from Person p in entities.Person select p;
but in this scenario, if we wanted the books, we have to explicitly load then:
foreach(Person p in persons){
p.Book.Load();
//Handle the books
}
This would do a query for each person just to retrieve the books.
But you can explicitly load the books right in the query:
Entities entities = new Entities();
var persons = from Person p in entities.Person.Include("Book")
select p;
this would allow you to load all the books from all the persons. This is called eager loading.
If you want to retrive all the persons and all the books and all the pages of those books, the query would be:
Entities entities = new Entities();
var persons = from Person p in entities.Person.Include("Book.Page")
select p;
Hi, What tool did you use for your diagram?
Thanks.
Oh, it’s so useful post
Волнуюсь ))
Hello, very much that we bookmarked your write-up Nuno Silva » Blog Archive » Lazy Loading and Eager Loading in the Entity Framework well done