We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Entity Framework and Entity Framework Core uses Include methods to manage Lazy Loading
Include
Get, GetAll, Find and FindAll methods have support for Include commands.
They can be passed in a several ways directly in methods, as lambda function
repository.GetAll(x => x.EmailAddresses);
In many cases you may need pass multiple includes, or navigate child members.
repository.Get(id, includePaths: new Expression<Func<Contract, object>>[] { c => c.Employee, c => c.Owners.First().Address });
or with string name, good for dynamic query
repository.GetAll("Employee", "Owners.Address" });
or with strategies
var strategy = new GenericFetchStrategy<Contract>(); strategy.Include(x => x.Employee); strategy.Include(x => x.Owners.First().Address); repository.Get(id, strategy);
or using specification
var spec = new Specification<Contract>(obj => obj.Employee.Name == "Jeff"); spec.FetchStrategy = new GenericFetchStrategy<Contract>(); spec.FetchStrategy .Include(x => x.Employee) .Include(x => x.Owners.First().Address); repository.FindAll(spec);
Home