From f1bc6a8c8be54149f8bead0748d54fa39b0ad93e Mon Sep 17 00:00:00 2001 From: Vytautas Stankus Date: Wed, 14 Jan 2015 21:02:49 +0200 Subject: [PATCH] does not return error if data is invalid --- Learning.Web/Controllers/CoursesController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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()) {