Beispiel #1
0
 public async Task <PaginatedList <ProductDto> > Handle(GetProductsWithPaginationQuery request, CancellationToken cancellationToken)
 {
     return(await _context.Products
            .Include(x => x.ProductType)
            .OrderBy(x => x.Name)
            .ProjectTo <ProductDto>(_mapper.ConfigurationProvider)
            .PaginatedListAsync(request.PageNumber, request.PageSize));
 }
Beispiel #2
0
 public async Task <PaginatedList <ProductDto> > GetProducts([FromQuery] GetProductsWithPaginationQuery query)
 {
     return(await Mediator.Send(query));
 }