Ejemplo n.º 1
0
 public Task <List <Category> > Handle(GetCategoriesByNameQuery request, CancellationToken cancellationToken)
 {
     return(_dbContext.Categories
            .AsNoTracking()
            .Where(x => x.Name.Contains(request.CategoryName))
            .ToListAsync()); // EF Core
 }
Ejemplo n.º 2
0
 public Task <List <Category> > Handle(GetCategoriesByNameQuery request, CancellationToken cancellationToken)
 {
     return(_uow.Categories
            .Where(x => x.Name.Contains(request.CategoryName))
            .ToListAsync()); // QueryableHelper
 }