public ActionResult Create(int parentMenuId, MenuItem menuitem) { if (ModelState.IsValid) { // TODO: Uncomment the code below //Menu menu = db.Menus.Single<Menu>(m => m.Id == parentMenuId); //menuitem.ParentMenu = menu; //db.MenuItems.Add(menuitem); //db.SaveChanges(); return RedirectToAction("Details", "Menu", new { id = parentMenuId }); } return View(menuitem); }
public ActionResult Edit(int parentMenuId, MenuItem menuitem) { if (ModelState.IsValid) { // TODO: Uncomment the code below //db.Entry(menuitem).State = EntityState.Modified; //db.SaveChanges(); return RedirectToAction("Details", "Menu", new { id = parentMenuId }); } return View(menuitem); }