Example #1
0
 public IHttpActionResult _GetCourseById(int id)
 {
     try
     {
         return(Ok(_service.GetCourseByID(id)));
     }
     catch (CourseNotFoundException)
     {
         throw new HttpResponseException(HttpStatusCode.NotFound);
     }
 }
Example #2
0
        public IHttpActionResult GetCourse(int ID)
        {
            //CourseDetailDTO
            CourseDetailsDTO retCourse = _service.GetCourseByID(ID);

            if (retCourse == null)
            {
                return(NotFound());
            }

            return(Ok(retCourse));
        }
Example #3
0
 public IHttpActionResult GetCourseByID(int id)
 {
     try
     {
         var result = _service.GetCourseByID(id);
         return(Content(HttpStatusCode.OK, result));
     }
     catch (AppObjectNotFoundException)
     {
         return(NotFound());
     }
 }