Skip to main content
Table of Contents

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

TBase

CLR type of the aggregate / read model the changes apply to.

TChanges

CLR 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

source TBase

The aggregate / read-model snapshot the caller observed when authoring the change-set.

current TBase

The live aggregate state to surface alongside each diff.

changes TChanges

The 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.