Does finding an entity using a key (like follows) eagerly load all related entities implicitly?
var person = context.People.Find(1);
Say the People
entities have related Children
entities, would they be eagerly loaded in the above lookup or would the following query be more suitable?
var person = context.People.Include("Children").First(p => p.Id == 1);
If the Children
entities are not eagerly loaded using Find
, and the database has to be hit again in order to fetch them (I assume), which of the methods is likely to be better performing?
Again, if the Find
method does not eagerly load the Children
entities, what is the correct way to load them?
Finally, is there some configuration that would cause the Children
- or even all related - entities to be eagerly loaded when using Find
?