Lightweight change tracking runtime for Fody weaver integration. Provides tracked entity interface, scope management, and attributes.
$ dotnet add package TrackableRuntime types for change tracking used by the Trackable.Fody weaver.
dotnet add package Trackable
Usually you install Trackable.Fody which brings this runtime transitively.
TrackedEntity on your model and expose an Id.[TrackedProperty].Scope and mutate properties; changes are recorded in Scope.Current.public class User : TrackedEntity
{
[TrackedProperty]
public string Id { get; set; }
[TrackedProperty]
public string Name { get; set; }
}
await using var scope = Scope.Open();
var user = new User { Id = "1" };
user.Name = "Alice"; // recorded as dirty within the scope
To flush, set Scope.Flusher to your async handler. When the scope ends, it will be invoked with a snapshot of dirty entities and properties.