I am trying to Eagerly load all the related entities or collection of Entity in one call. My Entities Looks like:
Class Person
{
public virtual long Id {
Since this is the first page in my search in google, I just wanted to post this.
Slauma's answer is fine. But it's recommended to use Load() instead of ToList() if you don't plan to actually use the list. So it would be:
Context.Employees
.Include(e => e.Person)
.Include(e => e.Titles.Select(t => t.Title))
.Load();
You can try this:
Context.Employees
.Include(e => e.Person)
.Include(e => e.Titles.Select(t => t.Title))
.ToList();
Select
can be applied to a collection and loads navigation properties of the next level in the object graph.