Skip to content

jeremysalwen/IIdentityResolutionInterceptorDemonstration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

IIdentityResolutionInterceptor Bug Demonstration

This demonstrates a bug (?) where IIdentityResolutionInterceptor.UpdateTrackedInstance() is not called when a query returns updated data for an already-tracked entity.

The Bug

  • 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.

Run

dotnet run

Output

=== Scenario A: Re-query ===
Title: Original

=== Scenario B: Attach ===
Interceptor called: existing=Blog { Id = 1, Title = Original }, new=Blog { Id = 1, Title = Attached }

About

A demonstration of a potential bug in IIdentityResolutionInterceptor

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages