title: Autofac - injected instance doesn't work as singleton
body: <p>I register necessary type with Autofac as <strong>InstancePerLifetimeScope</strong>:</p>
  
  <pre><code>builder.RegisterType&lt;WebSecurityContext&gt;()
                  .AsSelf()
                  .InstancePerLifetimeScope();
  </code></pre>
  
  <p>and resolve it through interface:</p>
  
  <pre><code>builder.Register&lt;IApplicationContext&gt;(context =&gt;
              {
                  return context.Resolve&lt;WebSecurityContext&gt;();
              })
              .As&lt;IApplicationContext&gt;();
  </code></pre>
  
  <p>I inject ApplicationContext in my WebAPI controller:</p>
  
  <pre><code>public class MedicalCenterController : BaseApiController
  {
      private readonly IApplicationContext applicationContext;
  
      public MedicalCenterController(IApplicationContext applicationContext)
      {
          this.applicationContext = applicationContext;
      }
  </code></pre>
  
  <p>ApplicationContext has <strong>MedicalCenterId</strong> value. This value should change after select of new medical center on UI.</p>
  
  <p>Changing of the MedicalCenterId occurs in the action filter which also contains the necessary context.</p>
  
  <pre><code>public class MedicalCenterAttribute : ActionFilterAttribute
  {
      public IApplicationContext ApplicationContext
      {
          get;
          set;
      }
  
      public override void OnActionExecuting(HttpActionContext filterContext)
      {
          .....
          ApplicationContext.SetMedicalCenterId(medicalCenterId);
      }
  }
  </code></pre>
  
  <p>But after it, ApplicationContext continues to have previous value of MedicalCenterId in MedicalCenterController and another controllers.</p>
  
  <p>Why autofac uses different instances in different classes, though I use <strong>InstancePerLifetimeScope</strong> object?</p>
  
  <p>Thanks.</p>