public ActionResult Create(MenuModel menumodel) { if (ModelState.IsValid) { db.Menus.Add(menumodel); db.SaveChanges(); return RedirectToAction("Index"); } return View(menumodel); }
public ActionResult Edit(MenuModel menumodel) { if (ModelState.IsValid) { db.Entry(menumodel).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(menumodel); }