public ActionResult Edit(Role role) { if (!ModelState.IsValid) return View(role); _dbContext.Entry(role).State = EntityState.Modified; _dbContext.SaveChanges(); return RedirectToAction("Index", "Roles"); }
public ActionResult Add(Role role) { if (!ModelState.IsValid) return View(role); _dbContext.Roles.Add(role); _dbContext.SaveChanges(); return RedirectToAction("Index", "Roles"); }