When going through a learning article about related entity loading in Entity Framework MSDN, I came across the following:
It is also possible to eagerly load multiple levels of related entities. The queries below show examples of how to do this for both collection and reference navigation properties.
...[Examples demonstrating the above]...
Note that it is not currently possible to filter which related entities are loaded. Include will always being in all related entities.
This seems slightly confusing, because the two statements seem to be in contradiction to each other. Am I missing something here?
For example, I could specify the Mother
navigation property should be included for every Child
in a Children
DBSet I am querying, like so:
Dim myQuery = From children In context.Children.Include("Mother")
Select child
Does that mean the Father
navigation property will also be eagerly evaluated for every Child
?
If this is not the case (Include
only eagerly loads what you tell it to), is there a way to eagerly load all navigation properties without specifying them?