public Task <List <GetAllProductsV1QueryResult> > Handle(GetAllProductsV1Query request, CancellationToken cancellationToken) { return(_dbContext.Products .Select(i => new GetAllProductsV1QueryResult { Category = i.Category, Description = i.Description, ID = i.ID, Name = i.Name, Price = i.Price }).ToListAsync(cancellationToken)); }
public Task <List <Product> > Handle(GetAllProductsV1Query request, CancellationToken cancellationToken) { return(_dbContext.Products.ToListAsync()); }