public IActionResult OnPostDeleteDiagnosis(int id) { var temp = diagnosesService.DeleteDiagnosis(id); if (temp == null) { return(RedirectToPage("NotFound")); } diagnosesService.Commit(); return(RedirectToPage("/Diagnosis/DiagnosisList", new { id = temp.PatientId })); }