예제 #1
0
        public async Task <IActionResult> GetAll(ProductCategoriesFilterModel filter)
        {
            var productCategories = await _service.Get(new ProductCategoriesFilter(new PageFilter(filter.Skip, filter.Take, MaxTake), filter.Id, filter.Title, filter.Descending, filter.OrderBy));

            return(Ok(new PageResultModel <ProductCategoryModel>()
            {
                ProductsFilter = productCategories.PageFilter,
                TotalCount = productCategories.TotalCount,
                Value = productCategories.Value.Select(p => new ProductCategoryModel(p)).ToList()
            }));
        }
 public IActionResult Get() => Ok(_context.Get());