public IActionResult DeleteStudent(int schoolId, int studentId) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } Student student = _schoolRepository.GetStudent(studentId, schoolId); if (student == null) { return(NotFound()); } _schoolRepository.DeleteStudent(student, schoolId); return(NoContent()); }