title: Ninject's in InRequestScope doesn't seem to return the same instance
body: <p>We made the mistake to define a new DbContext in each of our repositories. So during development, we were walking into a lot of these kind of errors:</p>
  
  <pre><code>An entity object cannot be referenced by multiple instances of IEntityChangeTracker.
  </code></pre>
  
  <p>So instead of disposing everywhere we figured the best thing to do is to make sure all of our repositories use the same context in each request. We had a NinjectControllerFactory initially, where we also placed our repository bindings. I installed the Ninject.Web.Commons nuget package and it created the NinjectWebCommon.cs file in App_Start.</p>
  
  <p>I moved my bindings all over to the NinjectWebCommon file, and made the NinjectControllerFactory use the same kernel. I added our DbContext class as a binding and gave it the InRequestScope method.</p>
  
  <pre><code>ninjectKernel.Bind&lt;EfDbContext&gt;().ToSelf().InRequestScope();
  </code></pre>
  
  <p>Each repository is now using referring to the context through the constructor.</p>
  
  <pre><code>public class EfPageRepository : IPageRepository
  {
      EfDbContext context;
  
      public EfPageRepository(EfDbContext dbContext)
      {
          this.context = dbContext;
      }
  }
  </code></pre>
  
  <p>Now the project builds fine, but we are still getting the same error as I described in the beginning of this post. Did I forgot a step here? I really can't find why it is not working.</p>