title: .AsNoTracking() not working entity framework core 5
body: <p>I am using entity framework with this configuration on the Startup:</p>
  <pre><code> services.AddDbContext&lt;ApplicationDbContext&gt;(options =&gt; 
              options.UseSqlServer(
                     Configuration.GetConnectionString(&quot;DefaultConnection&quot;),
                       //b =&gt; b.MigrationsAssembly(typeof(ApplicationDbContext).Assembly.FullName)
                       b =&gt; b.MigrationsAssembly(&quot;ThreeTasty.Infrastructure&quot;)
             )
             .UseLazyLoadingProxies()
              );
  </code></pre>
  <p>and in my Entity framework query I am trying to get the entity without tracking:</p>
  <pre><code> query = query.Include(x =&gt; x.OrderProducts.Where(x =&gt; x.Active == true))
                          .ThenInclude(x =&gt; x.Product)
                          .ThenInclude(x =&gt; x.ProductImages).AsNoTracking()
  
                          //order product with images
                          .Include(x =&gt; x.OrderProducts.Where(x =&gt; x.Active == true))
                          .ThenInclude(x =&gt; x.Product)
                          .ThenInclude(x =&gt; x.ProductVendors)
                          .ThenInclude(x =&gt; x.VendorProductSizeUnit).AsNoTracking();
  </code></pre>
  <p>Even after doing the <code>.AsNoTracking()</code> on the last entity <code>VendorProductSizeUnit</code> in the <code>.ThenInclude()</code> I get the following error while updating entity in a separate table:</p>
  <p>The instance of entity type 'VendorProductSizeUnit' cannot be tracked because another instance with the same key value for {'Id'} is already being tracked. When attaching existing entities, ensure that only one entity instance with a given key value is attached. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the conflicting key values.</p>