public IActionResult Edit(PerfilModel model) { PerfilService p = new PerfilService(_logger); try { if (ModelState.IsValid) { p.EditRol(model); SetTempData("Perfil editado correctamente !"); return(RedirectToAction("Index")); } else { return(View("Edit", model)); } } catch (Exception e) { SetTempData(e.Message, "error"); return(View("Edit", model)); } }