public ActionResult Edit(Role role) { if (ModelState.IsValid) { context.Entry(role).State = EntityState.Modified; context.SaveChanges(); return RedirectToAction("Index"); } return View(role); }
public ActionResult Create(Role role) { if (ModelState.IsValid) { context.Roles.Add(role); context.SaveChanges(); return RedirectToAction("Index"); } return View(role); }
public void InsertOrUpdate(Role role) { // Roles are different as there is only one column (primary key). Therefore there is really only insert // without messing up all of the relationships. context.Roles.Add(role); }