Class EFExtensions
- Namespace
- Breeze.Persistence.EFCore
- Assembly
- Breeze.Persistence.EFCore.dll
The Entity Framework implementations of the query steps EntityQuery leaves to the persistence layer.
public static class EFExtensions
- Inheritance
-
EFExtensions
- Inherited Members
Remarks
EFPersistenceManager plugs these in through EntityQuery's static hooks.
Methods
ApplyAsNoTracking(EntityQuery, IQueryable, Type)
Add AsNoTracking before a projection that may include an owned type.
public static IQueryable ApplyAsNoTracking(this EntityQuery eq, IQueryable queryable, Type eleType)
Parameters
eqEntityQueryThe query.
queryableIQueryableThe queryable to apply it to.
eleTypeTypeThe element type of the queryable.
Returns
- IQueryable
The queryable, unchanged unless the query projects a non-System type.
Remarks
EF Core requires an owned type to be queried together with its owner unless tracking is off. The test here is broader than it needs to be - any non-System return type counts - so AsNoTracking is sometimes applied when it was not strictly necessary.
ApplyExpand(EntityQuery, IQueryable, Type)
Apply the query's expand clause as EF Include calls.
public static IQueryable ApplyExpand(this EntityQuery eq, IQueryable queryable, Type eleType)
Parameters
eqEntityQueryThe query.
queryableIQueryableThe queryable to add Includes to.
eleTypeTypeThe element type of the queryable.
Returns
- IQueryable
The queryable, unchanged if there is no expand clause.