public IActionResult CreateRole(Role role) { if (ModelState.IsValid) { var newRole = new ManageRoles(); if(!newRole.CheckIfRoleExist(role)) { if (newRole.AddRole(role)) { return RedirectToAction("ListRoles", "Administration"); } else { ModelState.AddModelError("All", "Add role attempt unsuscessfull, please try again or refer to the error log"); return View(); } } else { ModelState.AddModelError("All","Role already exists, please enter a new role."); return View(); } } return View(); }