CapRaffle.Controllers.CategoryController.Edit C# (CSharp) Method

Edit() private method

private Edit ( Category category ) : System.Web.Mvc.ActionResult
category CapRaffle.Domain.Model.Category
return System.Web.Mvc.ActionResult
        public ActionResult Edit(Category category)
        {
            if (ModelStateAndCategoryNameIsValid(category))
            {
                if (CategoryAlreadyExists(category))
                {
                    this.Error("A category with that name already exists.");
                    //ModelState.AddModelError("", "A category with that name already exists.");
                    return View(category);
                }
                else
                {
                    repository.SaveCategory(category);
                    this.Success("The category has been saved");
                    return RedirectToAction("Index");
                }
            }
            return View(category);
        }

Same methods

CategoryController::Edit ( int categoryId ) : System.Web.Mvc.ViewResult