コード例 #1
0
        public IHttpActionResult DeleteSubjectFromStudent(string id, int subjectId)
        {
            if (studentsService.ExistsID(id) == false || subjectsService.ExistsID(subjectId) == false)
            {
                return(NotFound());
            }

            if (studentsService.StudentHasSubject(id, subjectId) == false)
            {
                return(BadRequest("Student does not have that subject in his/hers subject list"));
            }

            return(Ok(studentsService.DeleteSubjectFromStudent(id, subjectId)));
        }