Exemplo n.º 1
0
 public void RemoveStudentFromCourse(int courseID, string SSN)
 {
     try
     {
         _service.RemoveStudentFromCourse(courseID, SSN);
     }
     catch (AppObjectNotFoundException)
     {
         throw new HttpResponseException(HttpStatusCode.NotFound);
     }
 }
Exemplo n.º 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));
     }
 }