title: C# Unity Dependency Injection doesn't resolve the same object but creating new one
body: <p>I'm injecting one service to my controller and I'm resolving the same service manually, but this two services are not the same. Manually created service is disposing but auto resolved service is not disposing. Let me show by code.</p>
  
  <p>Here is controller, there is a IFirmService auto resolved and I have an other IFirmService in test function manually resolved. Here occurs the problem, there is two IFirmService resolved by unity but they are not the same.</p>
  
  <pre><code>public class TestmeController : ApiController
  {
      IFirmService FirmServiceHeader;
      public TestmeController(IFirmService _FirmServiceHeader)
      {
          //here is successfully resolved FirmService by unity resolver.
          this.FirmServiceHeader = _FirmServiceHeader;
      }
  
      [Route("api/test")]
      public IHttpActionResult test() {
          //Here is I'm resolving an other service manually.
          IFirmService FirmServiceLocal = this.Configuration.DependencyResolver.GetService(typeof(IFirmService)) as IFirmService;
  
          if (Object.ReferenceEquals(FirmServiceLocal,FirmServiceHeader)) {
              //Here is the problem, FirmServiceLocal and firmServiceHeader is not resolved as the same
          }
  
      }
  }
  </code></pre>
  
  <p><strong>WebApiConfig.cs</strong>
  I'm setting the default DependencyResolver as Unity and setting registered types.</p>
  
  <pre><code>public static class WebApiConfig
  {   
      public static void Register(HttpConfiguration config)
      {
          .....
          UnityContainr container = new UnityContainer();
          container.RegisterType&lt;IFirmService, FirmService&gt;(new HierarchicalLifetimeManager());
          //setting the dependency resolver.
          config.DependencyResolver = new UnityResolver(container);
          .....
      }
  }
  </code></pre>
  
  <p>I'm not writing here IFirmService and FirmService class, it is a disposable class.</p>
  
  <p>Summary; I want to resolve the same Firmservice in test() function. And I want to it automaticly disposed after each web api request.</p>
  
  <p>What is the best way for this?</p>