예제 #1
0
        public IQueryable <CategoryModel> GetAll()
        {
            var categories  = _categoryQueryProcessor.Get();
            var resultModel = _mapper.Map <CategoryEntity, CategoryModel>(categories);

            return(resultModel);
        }
예제 #2
0
        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);
        }