public IActionResult Delete(int Id) { PerfilService p = new PerfilService(_logger); try { var status = p.DeleteRol(Id); if (status) { SetTempData("No se puede eliminar rol Administrador.", "error"); return(RedirectToAction("Index")); } SetTempData("Perfil eliminado!!"); return(RedirectToAction("Index")); } catch (Exception e) { SetTempData(e.Message, "error"); return(View("Index")); } }