.agents/skills/change-tracking/SKILL.md
Manages entity states and detects changes for SaveChanges().
StateManager — central engine, identity maps, tracks all entitiesInternalEntityEntry — per-entity state, property flags, snapshotsSnapshotFactoryFactory subclasses build snapshot factories for change detectionPropertyAccessorsFactory, ClrPropertyGetterFactory and ClrPropertySetterFactory compile property accessors for efficient snapshotting and change detection
indices parameter specify element at each complex collection depthUnit tests: test/EFCore.Tests/ChangeTracking/. Functional tests: test/EFCore.Specification.Tests/GraphUpdates/.
| Pitfall | Solution |
|---|---|
| There is a failure when there is shared identity entry (Added and Deleted) | Add code that checks SharedIdentityEntry |
DetectChanges() identifies modified properties via snapshot comparison