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()); } }
public ActionResult <Course> UpdateCourse(string code, Course course) { _service.UpdateCourse(code, course); return(course); }