title: MVC 5 DBContext Dependency Injection Issue
body: <p>I'm using MVC5 with EF Core 2.2 and DI. I have the DbContext setup as Scoped but appears it's acting like a singlton. </p>
  
  <p>Request 1: Creates a Transaction Scope. Creates a new object1 in DbContext and adds it, Creates a new object2 adds it but fails and transaction rollsback.</p>
  
  <p>Request 2: Creates a Transaction Scope. Creates new object1 in DbContext but fails due to it already tracking changes from Request 1. It's not in the DB. Restarting web application allows the first request to go through again (because tracker is clear)</p>
  
  <p>I have no idea how it is still tracking that object if the second request should have been a completely new context, and have nothing in tracking. If I don't use DI and just instantiate the context in the controller, it works.</p>
  
  <blockquote>
    <p>Error: The instance of entity type cannot be tracked because another instance of this type with the same key is already being tracked</p>
  </blockquote>
  
  <pre><code>services.AddDbContext&lt;ApplicationDbContext&gt;(options =&gt;
  {
              options.UseSqlServer(ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString, builder =&gt;
              {
                  builder.UseRowNumberForPaging();
              });
  }, ServiceLifetime.Scoped);
  
  services.AddScoped(typeof(ChairManager));
  </code></pre>
  
  <p>ChairController with DI of Manager class</p>
  
  <pre><code>public ChairController(ChairManager chairManager, IServiceProvider services)...
  </code></pre>
  
  <p>ChairManager class with DI of Context</p>
  
  <pre><code>public ChairManager(ApplicationDbContext context)...
  </code></pre>
  
  <p>ChairController calling ChairManager method</p>
  
  <pre><code>await _chairManager.AddChairAsync(chair)
  </code></pre>
  
  <p>Now if I do something like this, and don't use DI. No issues at all...</p>
  
  <pre><code>public ChairController(IServiceProvider services)
  {
          var context = ApplicationDbContext.Create();
          _chairManager = new ChairManager2(context);
  }
  
  ...
  
  await _chairManager.AddChairAsync(chair)
  </code></pre>