This demonstrates a bug (?) where IIdentityResolutionInterceptor.UpdateTrackedInstance() is not called when a query returns updated data for an already-tracked entity.
- Expected: The interceptor should be called whenever EF Core performs identity resolution, including when a tracking query returns a new version of a tracked entity
- Actual: The interceptor is only called during explicit attach operations (like
Attach()), not during queries
This means database changes are silently ignored when re-querying tracked entities, with no opportunity to intercept.
dotnet run
=== Scenario A: Re-query ===
Title: Original
=== Scenario B: Attach ===
Interceptor called: existing=Blog { Id = 1, Title = Original }, new=Blog { Id = 1, Title = Attached }