コード例 #1
0
        public ActionResult Edit(CategoryViewModel categoryModel)
        {
            Category category = categoryModel.category;

            if (category == null)
            {
                throw new ArgumentNullException();
            }
            ModelState.Remove("category.ID");
            if (ModelState.IsValid)
            {
                _categoriesStorage.EditCategory(category);
            }
            else
            {
                RedirectToAction("HttpError500", "Error");
            }
            return(RedirectToAction("ShowAll"));
        }