public ActionResult Create(Category category) { if (ModelState.IsValid) { categoryRepository.Insert(category); categoryRepository.Save(); return RedirectToAction("Index"); } else { return View(); } }
public void Insert(Category category) { entities.Categories.Add(category); }