I'm writing an api controller in ASP 5. I want to return a bad request code exception if the parameters passed to the service are incorrect. In the current version of webapi I would do:
throw new HttpResponseException(HttpStatusCode.BadRequest);
However HttpResponseException
is part of System.Web
, which has been removed from ASP 5 and thus I cannot instantiate it anymore.
What is the proper way to do this in vNext?