// GET: Students/Delete/5 public async Task <IActionResult> Delete(int?id, bool?saveChangesError = false) { if (id == null) { return(NotFound()); } var students = await _servStudents.GetStudentByIDAsync(id); if (students == null) { return(NotFound()); } if (saveChangesError.GetValueOrDefault()) { ViewData["ErrorMessage"] = "Delete failed. Try again, and if the problem persists " + "see your system administrator."; } return(View(students)); }