title: Get Unity container reference in MVC controller action
body: <p>Is it possible to get the reference of the unity container used for resolving the Contructor injected paraeters for MVC Controller?</p>
  
  <p>I need the reference of the currently used container, because we have classes which use it.</p>
  
  <p>I am trying to save the reference of the registered during <code>Application_Start()</code> handler in the <code>MvcApplication</code> class, by storing the container instance in a property in the MvcApplication class, but it's null when i try to access it in the controllers later.</p>
  
  <p>The container is registered like so:</p>
  
  <pre><code>DependencyResolver.SetResolver(new UnityDependencyResolver(CurrentUnityContainer));
  </code></pre>
  
  <p>Provided that <code>CurrentUnityContainer</code> is a non-static property in the MvcApplication class</p>
  
  <p>Then, in the controller we try to get it by accessing the current MvcApplication instance like so:</p>
  
  <pre><code>MvcApplication.Instance.CurrentUnityContainer
  </code></pre>
  
  <p>Any ideas why the container is null in the controller, or other way to get it?</p>