コード例 #1
0
        public IActionResult DeleteCourse(int schoolId, int courseId)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            Course course = _schoolRepository.GetCourse(courseId, schoolId);

            if (course == null)
            {
                return(NotFound());
            }
            _schoolRepository.DeleteCourse(course, schoolId);
            return(NoContent());
        }