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