public ActionResult Create(FacultCreate facult) { if (ModelState.IsValid) { _db.Facults.Add(facult); _db.SaveChanges(); return RedirectToAction("Index"); } return View(facult); }
public ActionResult Create(FacultCreate model) { if (ModelState.IsValid) { _db.Facults.Add(model); _db.SaveChanges(); if (!Roles.RoleExists(model.FacultInstance.FacultId.ToString(CultureInfo.InvariantCulture))) Roles.CreateRole(model.FacultInstance.FacultId.ToString(CultureInfo.InvariantCulture)); return RedirectToAction("Index"); } return View(model); }