protected async Task <IQueryable <T> > ApplySpecification(ISpecification <T> spec) { return(await Task.Run(() => { return _specificationEvaluator.GetQuery(_dbContext.Set <T>().AsQueryable(), spec); })); }
private IQueryable <T> ApplySpecification(ISpecification <T> specification) { return(specificationEvaluator.GetQuery(_dbContext.Set <T>().AsQueryable(), specification)); }
/// <summary> /// Filters the entities of <typeparamref name="T"/>, to those that match the encapsulated query logic of the /// <paramref name="specification"/>. /// </summary> /// <param name="specification">The encapsulated query logic.</param> /// <returns>The filtered entities as an <see cref="IQueryable{T}"/>.</returns> protected virtual IQueryable <T> ApplySpecification(ISpecification <T> specification, bool evaluateCriteriaOnly = false) { return(specificationEvaluator.GetQuery(dbContext.Set <T>().AsQueryable(), specification, evaluateCriteriaOnly)); }
/// <summary> /// Apply specification using entityframework specification evaluator /// </summary> /// <param name="spec">specification</param> /// <param name="singleInstance">single instance query ?</param> /// <returns>query</returns> private IQueryable <T> ApplySpecification(ISpecification <T> spec, bool singleInstance = false) { return(evaluator.GetQuery(dbContext.Set <T>().AsQueryable(), spec, singleInstance)); }
/// <summary> /// /// </summary> /// <param name="specification"></param> /// <returns></returns> protected IQueryable <TEntity> ApplySpecification(ISpecification <TEntity> specification) { return(_specification.GetQuery(DbSet, specification)); }
public static IQueryable <TSource> WithSpecification <TSource>(this IQueryable <TSource> source, ISpecification <TSource> specification, ISpecificationEvaluator evaluator = null) where TSource : class { evaluator = evaluator ?? SpecificationEvaluator.Default; return(evaluator.GetQuery(source, specification)); }