public async Task <IEnumerable <ProductCategoryResource> > GetAllAsync()
        {
            var categories = await _categoryService.ListAsync();

            var resources = _mapper.Map <IEnumerable <ProductCategory>, IEnumerable <ProductCategoryResource> >(categories);

            return(resources);
        }
Example #2
0
        public async Task <ActionResult <List <ProductCategoryResult> > > List(string tenantSlug)
        {
            var categories = await _productCategoryService.ListAsync(tenantSlug);

            return(Ok(categories.Select(item => new ProductCategoryResult(item))));
        }