public ActionResult Create(Permission permission) { try { // TODO: Add insert logic here if(ModelState.IsValid) { db.Permissions.Add(permission); db.SaveChanges(); return RedirectToAction("Index"); } return View(permission); } catch { return View(); } }
public ActionResult Edit(int id, Permission permission) { try { // TODO: Add update logic here if (ModelState.IsValid) { db.Entry(permission).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(permission); } catch { return View(); } }