Class ChangeSetBuilder<TBase, TChanges>
- Namespace
- Stratara.Shared.Merging.ChangeTracking
- Assembly
- Stratara.Shared.dll
Diff-only counterpart to ChangeMerger<TBase, TChanges>. Produces the list of per-property differences between the caller-visible source, the live current state, and the incoming change-set payload without applying any mutations.
public static class ChangeSetBuilder<TBase, TChanges> where TBase : notnull where TChanges : notnull
Type Parameters
TBaseCLR type of the aggregate / read model the changes apply to.
TChangesCLR type of the change-set payload (e.g. an update command).
- Inheritance
-
ChangeSetBuilder<TBase, TChanges>
- Inherited Members
Remarks
Property accessors are compiled and cached per-type-combination. Properties that exist on
TChanges but not on TBase are skipped — only
comparable property pairs surface in the result.
Methods
CreateChangeSet(TBase, TBase, TChanges)
Returns the per-property ChangeDetail entries for fields whose incoming value
differs from source.
public static IReadOnlyList<ChangeDetail> CreateChangeSet(TBase source, TBase current, TChanges changes)
Parameters
sourceTBaseThe aggregate / read-model snapshot the caller observed when authoring the change-set.
currentTBaseThe live aggregate state to surface alongside each diff.
changesTChangesThe incoming change-set payload.
Returns
- IReadOnlyList<ChangeDetail>
Read-only list of ChangeDetail entries for changed fields; never null.
Exceptions
- ArgumentNullException
Thrown when any argument is null.