public async Task <PagedResponse <IEnumerable <GetAllProductsViewModel> > > Handle(GetAllProductsQuery request, CancellationToken cancellationToken)
        {
            var validFilter = _mapper.Map <GetAllProductsParameter>(request);
            var product     = await _productRepository.GetPagedReponseAsync(validFilter.PageNumber, validFilter.PageSize);

            var productViewModel = _mapper.Map <IEnumerable <GetAllProductsViewModel> >(product);

            return(new PagedResponse <IEnumerable <GetAllProductsViewModel> >(productViewModel, validFilter.PageNumber, validFilter.PageSize));
        }
Beispiel #2
0
        public async Task <PagedResponse <IEnumerable <GetAllProductsDto> > > Handle(GetAllProductsQuery request, CancellationToken cancellationToken)
        {
            var validFilter = _mapper.Map <GetAllProductsRequest>(request);
            var products    = await _ProductRepository.GetPagedReponseAsync(validFilter.PageNumber, validFilter.PageSize);

            var response = _mapper.Map <IEnumerable <GetAllProductsDto> >(products);

            return(new PagedResponse <IEnumerable <GetAllProductsDto> >(response, validFilter.PageNumber, validFilter.PageSize));
        }