public IQueryable <CategoryModel> GetAll() { var categories = _categoryQueryProcessor.Get(); var resultModel = _mapper.Map <CategoryEntity, CategoryModel>(categories); return(resultModel); }
public async Task<IActionResult> GetCategories([FromQuery] uint pageNumber, [FromQuery] uint pageSize) { var pagedData = queryProcessor.Get().PaginateQuery(pageNumber, pageSize).Include(category => category.Products).ToList(); var pagedResponse = pagedData.GetPagedResponse<Category, DtoCategoryGet>(autoMapper, uriService, Request.Path.Value, pageNumber, pageSize, queryProcessor.Get().Count()); return Ok(pagedResponse); }