Agents & OrchestrationSûr100100/100

Change Tracking (.NET)

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

ou envoie-le directement à ton agent.

Installer dans ton projet

$ curl -fsSL https://arboristhree.xyz/cli/install-skill.mjs -o /tmp/arboris-install-skill.mjs && node /tmp/arboris-install-skill.mjs change-tracking__dotnet-dotnet__src-efcore-agents-skills-a355da523be9
.NET
dotnet/dotnet
Contenu à copier
---
name: change-tracking
description: 'Implementation details for EF Core change tracking. Use when changing InternalEntityEntry, ChangeDetector, SnapshotFactoryFactory, or related entity state, snapshot, or property accessor code.'
user-invocable: false
metadata:
  origin: .NET
---

# 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

| Pitfall | Solution |
|---------|----------|
| 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
Colle ce Markdown dans ton agent ou utilise les boutons ci-dessus pour l’écrire dans ton projet.

Ce que fait Change Tracking (.NET)

`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

Comment utiliser Change Tracking (.NET)

1
Copie le prompt
Un clic copie le prompt packagé (ou l'envoie à ton agent).
2
L'agent installe le skill
Il ajoute le SKILL.md et ses ressources à ton projet.
3
Activation automatique
Le skill s'active dès que le contexte correspond.

Déclencheurs pour Change Tracking (.NET)

Dis simplement à ton agent quelque chose comme :

Applique le skill change-tracking__dotnet-dotnet__src-efcore-agents-skills-a355da523be9 à cette tâche
Utilise change-tracking__dotnet-dotnet__src-efcore-agents-skills-a355da523be9 pour améliorer cette implémentation
Passe en revue ce sujet avec change-tracking__dotnet-dotnet__src-efcore-agents-skills-a355da523be9

Skills liés à Change Tracking (.NET)