This project is read-only.

Http WEbApi Dependency resolver and current http request

Topics: ASP.NET Web API
Jun 11, 2012 at 5:18 PM

I am working on a multi-tenant app and I discover the tenant associated with a request based on the url. 

Some of the components in my container depend on the Request Url to be resolved.

In the beta I could not use HttpContext.Current for some reason as it was null but now in the RC it is properly created.

Should I rely on HttpContext to resolve my components or is there any way to get hold of the HttpRequestMessage in the DependencyResolver?



Jun 11, 2012 at 8:45 PM

Unfortunately there is no way to get access to the HttpRequestMessage from the dependency resolver.

Feel free to file an issue concerning this in our public issue tracker.

Daniel Roth

Jun 11, 2012 at 9:48 PM

Thanks Daniel,

Here is the issue in the issue tracker: