Exemple #1
0
 public new async Task <Activity> SingleOrDefaultAsync(Expression <Func <Activity, bool> > predicate)
 {
     return((await SelectEntityQuery.Where(predicate)
             .ToListAsync())
            .MergeCache(_cachedActivities)
            .SingleOrDefault(a => predicate.Compile()(a)));
 }
Exemple #2
0
 public new async Task <Activity> FirstOrDefaultAsync(Expression <Func <Activity, bool> > predicate,
                                                      Sort <Activity> sort = Sort <Activity> .Unsorted)
 {
     return((await SelectEntityQuery.Where(predicate).ToListAsync())
            .MergeCache(_cachedActivities)
            .FirstOrDefault(a => predicate.Compile()(a)));
 }
Exemple #3
0
 public new async Task <List <Activity> > FindAllAsync(Expression <Func <Activity, bool> > predicate,
                                                       PageRequest pageRequest)
 {
     return((await SelectEntityQuery.Where(predicate)
             .SortBy(pageRequest.SortBy)
             .ToListAsync())
            .MergeCache(_cachedActivities)
            .Where(a => predicate.Compile()(a))
            .Skip(pageRequest.Page * pageRequest.Size)
            .Take(pageRequest.Size)
            .ToList());
 }
 public new async Task <Attachment> FindByIdAsync(IAttachmentRepository.AttachmentKey id)
 {
     return(await SelectEntityQuery
            .Where(x => x.Num == id.Num && x.AttachmentsCode == id.Code)
            .SingleOrDefaultAsync());
 }