Table of Contents

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

context DbContext

The DbContext instance this method extends.

specification Specification<TEntity>

The specification describing the query.

Returns

IQueryable<TEntity>

A query that has not been executed yet.

Type Parameters

TEntity

The type of the entity to query.

Exceptions

ArgumentNullException

specification is null.