Esempio n. 1
0
        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());
        }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
        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());
        }
Esempio n. 4
0
 public virtual async Task <List <TEntity> > FindAsync(IRootSpecification <TEntity> rootSpecification,
                                                       IAggregatSpecification <TEntity> treeSpecification = null)
 {
     return(await FindAsync(rootSpecification.ToExpression(), treeSpecification));
 }
Esempio n. 5
0
 public async Task <TEntity> FindSingleAsync(IRootSpecification <TEntity> rootSpecification
                                             , IAggregatSpecification <TEntity> treeSpecification = null)
 {
     return(await FindSingleAsync(rootSpecification.ToExpression(), treeSpecification));
 }