Exemplo n.º 1
0
        public void DeleteCourse(int ID)
        {
            bool deleteSuccessful = _service.DeleteCourse(ID);

            if (!deleteSuccessful)
            {
                throw new HttpResponseException(HttpStatusCode.NotFound);
            }
        }
Exemplo n.º 2
0
 public void DeleteCourse(int ID)
 {
     try
     {
         _service.DeleteCourse(ID);
     }
     catch (AppObjectNotFoundException)
     {
         throw new HttpResponseException(HttpStatusCode.NotFound);
     }
 }
Exemplo n.º 3
0
 public void DeleteCourse(int id)
 {
     try
     {
         _service.DeleteCourse(id); // this may throw a not found exception
     }
     catch (CourseNotFoundException)
     {
         throw new HttpResponseException(HttpStatusCode.NotFound);
     }
     catch (DeleteFromDatabaseException)
     {
         throw new HttpResponseException(HttpStatusCode.InternalServerError);
     }
 }