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