diff --git a/Learning.Web/Controllers/CoursesController.cs b/Learning.Web/Controllers/CoursesController.cs index b43cda9..5fef88f 100644 --- a/Learning.Web/Controllers/CoursesController.cs +++ b/Learning.Web/Controllers/CoursesController.cs @@ -79,7 +79,7 @@ public HttpResponseMessage Post([FromBody] CourseModel courseModel) var entity = TheModelFactory.Parse(courseModel); - if (entity == null) Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Could not read subject/tutor from body"); + if (entity == null) return Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Could not read subject/tutor from body"); if (TheRepository.Insert(entity) && TheRepository.SaveAll()) {