IgnoreAutoIncludes
The IgnoreAutoIncludes
feature is used to instruct EF Core
to ignore automatic includes for this query. This is useful when you want to override the default behavior of automatically including navigation properties configured with AutoInclude
in your model. It simply passes along this call to the underlying EF Core feature for disabling automatic includes.
Compatible with the following providers:
- EF Core
- EF6 - not supported
The following example shows how to add IgnoreAutoIncludes
to a specification.
public class CustomerSpec : Specification<Customer>
{
public CustomerSpec(string name)
{
Query.Where(x => x.Name == name)
.IgnoreAutoIncludes();
}
}