public IActionResult DeleteStudent(int studentId) { if (!_repo.StudentExists(studentId)) { return(NotFound()); } var studentToDelete = _repo.GetStudent(studentId); _repo.DeleteStudent(studentToDelete); if (!_repo.Save()) { return(StatusCode(500, $"A problem happened while handling your request to create a Student with id: {studentId}.")); } return(NoContent());//success }