public ActionResult AddCategory(Category category) { if (ModelState.IsValid) { repository.Add(category); return RedirectToAction("Index"); } return View(category); }
public ActionResult AddCategory() { Category category = new Category(); return View(category); }