public IActionResult Delete(int?id) { if (id == null) { return(RedirectToAction(nameof(Error), new { message = "Id not provided" })); } var obj = _usuarioService.FindById(id.Value); if (obj == null) { return(RedirectToAction(nameof(Error), new { message = "Id not found" })); } return(View(obj)); }