How can I access the query string from a self hosted MVC WebAPI?
Call to the following failed with NRE, because Current is empty (aka. null)
System.Web.HttpContext.Current.Request["myQuery"]
I need access to the current context outside of the controller, since I want to control my object instantiation via. DI. eg.
container
.RegisterType<MyObject>(
new InjectionFactory(
uc =>
new MyObject(
System.Web.HttpContext.Current.Request["myParam"]) //This failed.
));
Call to container.Resolve<MyObject>()
from inside the ControllerApi code failed, because of the above NRE.