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