示例#1
0
 public IHttpActionResult UpdateCourseByID(int id, UpdateCourseViewModel model)
 {
     Debug.Print("hehe");
     if (ModelState.IsValid)
     {
         try
         {
             //var result = _service.UpdateCourseByID(id, model);
             //return Content(HttpStatusCode.OK, result);
             _service.UpdateCourseByID(id, model);
             return(Ok());
         }
         catch (AppObjectNotFoundException)
         {
             return(NotFound());
         }
     }
     else
     {
         return(StatusCode(HttpStatusCode.PreconditionFailed));
     }
 }