Exemplo n.º 1
0
        public int AddCategory(AddCategoryProdViewModel addCategory)
        {
            Category category = new Category
            {
                Name      = addCategory.Name,
                Published = addCategory.Published
            };

            _categoryRepository.Add(category);
            _categoryRepository.SaveChanges();
            return(category.Id);
        }
Exemplo n.º 2
0
        public ActionResult Add(AddCategoryProdViewModel category)
        {
            int result = _productProvider.AddCategory(category);

            return(RedirectToAction("Index"));
        }