Exemplo n.º 1
0
 protected Task <IQueryable <TResult> > ApplySpecification <TEntity, TResult>(ISpecification <TEntity> spec,
                                                                              IConfigurationProvider configurationProvider)
     where TEntity : class
     where TResult : class
 {
     return(Task.FromResult(EfSpecificationEvaluator <TEntity, TResult> .GetQuery(
                                _context.Set <TEntity>().AsQueryable(), spec, configurationProvider)
                            ));
 }
Exemplo n.º 2
0
        //static List<Kisi> KisileriGetir(Expression<Func<Kisi,bool>>where, Expression<Func<Kisi, string>> orderBy, int take)
        //{
        //    return db.Kisiler.Where(where).OrderBy(orderBy).Take(take).ToList();
        //}

        static async Task <List <Kisi> > KisileriGetir(ISpecification <Kisi> specification)
        {
            return((await EfSpecificationEvaluator <Kisi> .GetQuery(db.Kisiler, specification)).ToList());
        }
Exemplo n.º 3
0
 private async Task <IQueryable <T> > ApplySpecification(ISpecification <T> specification)
 {
     return(await EfSpecificationEvaluator <T> .GetQuery(_dbContext.Set <T>().AsQueryable(), specification));
 }
Exemplo n.º 4
0
 private IQueryable <T> ApplySpecification(ISpecification <T> spec)
 {
     return(EfSpecificationEvaluator <T, int> .GetQuery(_dbContext.Set <T>().AsQueryable(), spec));
 }
Exemplo n.º 5
0
 private IQueryable <TResult> ApplySpecification <TResult>(ISpecification <T, TResult> spec)
 {
     return(EfSpecificationEvaluator <T, TResult> .GetQuery(_dbContext.Set <T>().AsQueryable(), spec).Result);
 }
Exemplo n.º 6
0
 protected Task <IQueryable <TEntity> > ApplySpecification <TEntity>(ISpecification <TEntity> spec)
     where TEntity : class
 {
     return(Task.FromResult(
                EfSpecificationEvaluator <TEntity> .GetQuery(_context.Set <TEntity>().AsQueryable(), spec)));
 }
Exemplo n.º 7
0
 public Task <List <T> > ListBySpecAsync <T>(ISpecification <T> spec) where T : BaseEntity
 {
     return(EfSpecificationEvaluator <T, int>
            .GetQuery(_dbContext.Set <T>(), spec)
            .ToListAsync());
 }
Exemplo n.º 8
0
 public Task <T> GetBySpecAsync <T>(ISpecification <T> spec) where T : BaseEntity
 {
     return(EfSpecificationEvaluator <T, int>
            .GetQuery(_dbContext.Set <T>(), spec)
            .SingleOrDefaultAsync());
 }