public virtual async Task <List <TEntity> > AllAsync(IAggregatSpecification <TEntity> treeSpecification = null) { if (treeSpecification == null) { return(await entitySet.ToListAsync()); } return(await BuildAggregate(treeSpecification.IncludeLeafs, treeSpecification.IncludeTrees) .ToListAsync()); }
public async Task <TEntity> FindSingleAsync(Expression <Func <TEntity, bool> > rootSpecification , IAggregatSpecification <TEntity> treeSpecification = null) { if (treeSpecification == null) { return(await entitySet.FirstOrDefaultAsync(rootSpecification)); } return(await BuildAggregate(treeSpecification.IncludeLeafs, treeSpecification.IncludeTrees) .FirstOrDefaultAsync(rootSpecification)); }
public virtual async Task <List <TEntity> > FindAsync(Expression <Func <TEntity, bool> > rootSpecification, IAggregatSpecification <TEntity> treeSpecification = null) { if (treeSpecification == null) { return(await entitySet.Where(rootSpecification).ToListAsync()); } return(await BuildAggregate(treeSpecification.IncludeLeafs, treeSpecification.IncludeTrees) .Where(rootSpecification) .ToListAsync()); }
public virtual async Task <List <TEntity> > FindAsync(IRootSpecification <TEntity> rootSpecification, IAggregatSpecification <TEntity> treeSpecification = null) { return(await FindAsync(rootSpecification.ToExpression(), treeSpecification)); }
public async Task <TEntity> FindSingleAsync(IRootSpecification <TEntity> rootSpecification , IAggregatSpecification <TEntity> treeSpecification = null) { return(await FindSingleAsync(rootSpecification.ToExpression(), treeSpecification)); }