Exemplo n.º 1
0
        public async Task <IActionResult> AddCategory(NewProductCategoryViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            await _productRepository.AddProductCategoryAsync(model.CategoryName);

            return(RedirectToAction(nameof(Categories)));
        }