I have a WebAPI controller and in circumstances I like to tell to the caller, that the content is malformed in form of a Bad Request response.
My operation method looks like this:
[HttpPost()]
public string Post([FromBody] ComplexType content)
{
// logic ...
}
I know that I can call this.BadRequest, but since my operation method has return type string, this helps me quite little.
How can I produce a Bad Request with the method shown above, without changing return type?
ActionResult<>within the controller and handle these things in the concrete controller method.