In one of my method I have to return IHttpActionResult from there in Web API 2. When succeeded it returns Ok() either it returns BadRequest() with some message.
I am setting the message of BadRequest in the following way. But the problem is that I am unable to retrieve the error message from the called method. I am using Visual Studio 2013 Update 4 and the version is MVC 5.
return BadRequest("Error! Error adding the device");
Please help. Thanks in advance.