Consists of three libraries, which are available as packages on NuGet.org
ITrackingState interface with TrackingState enum, for use by client and service projects.TrackableEntities.Client:
Portable class library with a change-tracking collection that sets state as entities are added, removed, or modified.TrackableEntities.EF.5, TrackableEntities.EF.6:
Contain extension methods for DbContext which set entity state, so they can be persisted in a single transaction.
Changes in Version 1.0.1 (from v 1.0)
- EF5 and EF6 libraries include an AcceptChanges extension method on ITrackable, which sets entities in the object graph to Unchanged and removes ModifiedProperties. Call this method in a service after persisting updates and before returning updated entities to the client.
- Client library includes a MergeChanges method on ChangeTrackingCollection, which merges updates into an existing entity after an update has taken place, setting tracking state to Unchanged.
- Project and T4 templates updated to include calls to AcceptChanges and MergeChanges.
- Other project and T4 template improvements, such as loading related entities in both PUT and POST operations, and minor bug fixes.
- Updated all samples to use version 1.0.1 of libraries and templates.