CtrlK
BlogDocsLog inGet started
Tessl Logo

change-tracking

Implementation details for EF Core change tracking. Use when changing InternalEntityEntry, ChangeDetector, SnapshotFactoryFactory, or related entity state, snapshot, or property accessor code.

68

Quality

81%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide

SecuritybySnyk

Passed

No findings from the security scan

SKILL.md
Quality
Evals
Security

Change Tracking

Manages entity states and detects changes for SaveChanges().

Core Components

  • StateManager — central engine, identity maps, tracks all entities
  • InternalEntityEntry — per-entity state, property flags, snapshots
  • SnapshotFactoryFactory subclasses build snapshot factories for change detection
  • PropertyAccessorsFactory, ClrPropertyGetterFactory and ClrPropertySetterFactory compile property accessors for efficient snapshotting and change detection
    • Ordinals in indices parameter specify element at each complex collection depth

Testing

Unit tests: test/EFCore.Tests/ChangeTracking/. Functional tests: test/EFCore.Specification.Tests/GraphUpdates/.

Common Pitfalls

PitfallSolution
There is a failure when there is shared identity entry (Added and Deleted)Add code that checks SharedIdentityEntry

Validation

  • DetectChanges() identifies modified properties via snapshot comparison
  • Setting original values marks properties as modified or unchanged based on comparison with current values
Repository
dotnet/efcore
Last updated
First committed

Also appears in

dotnet/dotnet
In sync

since Jul 28, 2026

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.