コード例 #1
0
ファイル: CoursesController.cs プロジェクト: RagnarRa/Moo2
 public void RemoveStudentFromCourse(int courseID, string SSN)
 {
     try
     {
         _service.RemoveStudentFromCourse(courseID, SSN);
     }
     catch (AppObjectNotFoundException)
     {
         throw new HttpResponseException(HttpStatusCode.NotFound);
     }
 }
コード例 #2
0
 public IHttpActionResult DeleteStudentFromCourse(int id, string ssn)
 {
     try
     {
         _service.RemoveStudentFromCourse(id, ssn);
         return(StatusCode(HttpStatusCode.NoContent));
     }
     catch (AppPersonNotFoundException)
     {
         return(NotFound());
     }
     catch (AppObjectNotFoundException)
     {
         return(NotFound());
     }
     catch (NotEnrolledInClassException)
     {
         return(StatusCode(HttpStatusCode.PreconditionFailed));
     }
 }