public ActionResult Create(Menu collection) { try { if(ModelState.IsValid) { _menurepo.Add(collection); _menurepo.Save(); } else { //Validation Error return View(); } return RedirectToAction("Index"); } catch { return View(); } }
public void Add(Menu menu) { GCContext.Menus.Add(menu); }