public async Task <IActionResult> Get([FromQuery] GetAllProductCategoriesQuery filter)
 {
     return(Ok(await _mediator.Send(new GetAllProductCategoriesQuery()
     {
         PageSize = filter.PageSize, PageNumber = filter.PageNumber
     })));
 }
        public async Task <IEnumerable <ProductCategoryViewModel> > Handle(GetAllProductCategoriesQuery request, CancellationToken cancellationToken)
        {
            var productCategories = await _allMarktQueryContext
                                    .ProductCategories
                                    .ToListAsync(cancellationToken);

            return(from productCategory in productCategories
                   select new ProductCategoryViewModel
            {
                Id = productCategory.Id,
                Name = productCategory.Name,
                Description = productCategory.Description,
                ShopId = productCategory.Shop.Id,
                ShopName = productCategory.Shop.User.DisplayName
            });
        }