public async Task <IActionResult> ChangeCourseStatus(int id, string UserEmail, [FromBody] EnrolledCourse enrolledCourse) { if (ModelState.IsValid && id == enrolledCourse.Id) { bool result = await repository.ChangeCourseStatusAsync(enrolledCourse, UserEmail); if (result) { return(Created("UpdatedCourse", enrolledCourse.Id)); } } return(BadRequest(ModelState)); }