public async Task <GetProductCategoriesResponse> GetAllAsync()
        {
            var result = await _productCategoriesService.GetAllAsync();

            var response = new GetProductCategoriesResponse()
            {
                ProductCategories = result.Value
                                    .Select(p => _convertService.Convert <ProductCategory, ProductCategoryContract>(p))
                                    .ToList()
            };

            return(response);
        }
Пример #2
0
        public async Task <ActionResult> GetAllAsync()
        {
            var productCategories = await _productCategoriesService.GetAllAsync();

            return(Ok(productCategories));
        }