public async Task <PagedResponse <IEnumerable <GetAllCategoriesDto> > > Handle(GetAllCategoriesQuery request, CancellationToken cancellationToken) { var validFilter = _mapper.Map <GetAllCategoriesRequest>(request); var categories = await _CategoryRepository.GetPagedReponseAsync(validFilter.PageNumber, validFilter.PageSize); var response = _mapper.Map <IEnumerable <GetAllCategoriesDto> >(categories); return(new PagedResponse <IEnumerable <GetAllCategoriesDto> >(response, validFilter.PageNumber, validFilter.PageSize)); }