Ejemplo n.º 1
0
 public async Task <IEnumerable <T> > GetByCategoryAsync <T>(CategoryOfGuide categoryName, int take, int skip = 0)
 => await this.repository.All()
 .Where(x => x.Category == categoryName)
 .OrderByDescending(x => x.CreatedOn)
 .Skip(skip)
 .Take(take)
 .To <T>()
 .ToListAsync();
Ejemplo n.º 2
0
 public async Task <int> GetCountByCategoryAsync(CategoryOfGuide categoryName)
 => await this.repository.All()
 .Where(x => x.Category == categoryName)
 .CountAsync();