Class SpecificationExtensions
- Namespace
- KYS.EFCore.Library.Extensions
- Assembly
- KYS.EFCore.Library.dll
Provides extension methods for querying a DbContext with a Specification<T>.
public static class SpecificationExtensions
- Inheritance
-
SpecificationExtensions
- Inherited Members
Methods
ApplySpecification<TEntity>(DbContext, Specification<TEntity>)
Builds a query on the DbSet<TEntity> of TEntity that applies the
no-tracking option, the includes and the filter of the specification.
public static IQueryable<TEntity> ApplySpecification<TEntity>(this DbContext context, Specification<TEntity> specification) where TEntity : class
Parameters
contextDbContextThe DbContext instance this method extends.
specificationSpecification<TEntity>The specification describing the query.
Returns
- IQueryable<TEntity>
A query that has not been executed yet.
Type Parameters
TEntityThe type of the entity to query.
Exceptions
- ArgumentNullException
specificationis null.