コード例 #1
0
        public IActionResult Put(int id, [FromBody] CourseEntity courseEntity)
        {
            if (id == courseEntity.Id)
            {
                _courseServices.UpdateCourse(id, courseEntity);

                return(Ok(courseEntity));
            }
            return(NotFound());
        }
コード例 #2
0
 public ActionResult UpdateCourse([FromRoute] int id, [FromBody] Course course)
 {
     if (!ModelState.IsValid)
     {
         return(BadRequest(ModelState));
     }
     if (id != course.CourseId)
     {
         return(BadRequest("Id's did not match!! "));
     }
     else
     {
         _COURSEDAL.UpdateCourse(id, course);
         return(Ok());
     }
 }
コード例 #3
0
 public ActionResult <Course> UpdateCourse(string code, Course course)
 {
     _service.UpdateCourse(code, course);
     return(course);
 }