Welcome to the navigation

Qui tempor consequat, ut deserunt enim voluptate dolore in ipsum sint quis elit, in esse ut excepteur fugiat dolor anim non cillum duis incididunt ex. Sint et excepteur eu quis nulla labore nisi adipisicing magna officia nostrud dolore dolore duis irure est deserunt ullamco veniam, ipsum non in aliquip consequat

Yeah, this will be replaced... But please enjoy the search!

Creating your custom HttpControllerContext for Web API

I needed to fiddle a bit in a API method returning a HttpResponseMessage when validating captchas that wasn't included in the model validation.

HttpConfiguration config = new HttpConfiguration();
IHttpRouteData route = new HttpRouteData(new HttpRoute());
HttpRequestMessage req = new HttpRequestMessage();
req.Properties[HttpPropertyKeys.HttpConfigurationKey] = config;
req.Properties[HttpPropertyKeys.HttpRouteDataKey] = route;
HttpControllerContext context = new HttpControllerContext(config, route, req);