Ejemplo n.º 1
0
        public IActionResult Put(int id, [FromBody] CourseEntity courseEntity)
        {
            if (id == courseEntity.Id)
            {
                _courseServices.UpdateCourse(id, courseEntity);

                return(Ok(courseEntity));
            }
            return(NotFound());
        }
 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());
     }
 }
Ejemplo n.º 3
0
 public ActionResult <Course> UpdateCourse(string code, Course course)
 {
     _service.UpdateCourse(code, course);
     return(course);
 }