Return an object along with a 409 Conflict error in a Web API 2 POST call backed by Entity Framework?

asp.net-mvc asp.net-web-api2 c# entity-framework-6

Accepted Answer

ZZZ_tmp
14
11/2/2017 9:01:00 AM

Popular Answer

You must send this content back.

return Content(HttpStatusCode.Conflict, original);

Content a technique on theApiController class that will produce aNegotiatedContentResult Use the suppliedHttpStatusCode and satisfied. As in the acceptable answer, there is no need to add your own extension function to the ApiController class.



Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow