Class MaterializedReadModelDiffer

Namespace
Cratis.Chronicle.ReadModels
Assembly
Cratis.Chronicle.dll

Detects added, modified and removed read model instances by diffing successive materialized windows.

public class MaterializedReadModelDiffer
Inheritance
MaterializedReadModelDiffer
Inherited Members
Extension Methods

Remarks

The materialized API delivers a full window of instances on every change. Because the deserialized read model no longer carries the last handled event sequence number, change type is determined by comparing the serialized value of each instance — keyed by its id property — against the previous window.

Constructors

MaterializedReadModelDiffer(JsonSerializerOptions)

Detects added, modified and removed read model instances by diffing successive materialized windows.

public MaterializedReadModelDiffer(JsonSerializerOptions jsonSerializerOptions)

Parameters

jsonSerializerOptions JsonSerializerOptions

The JsonSerializerOptions used to serialize instances for comparison.

Remarks

The materialized API delivers a full window of instances on every change. Because the deserialized read model no longer carries the last handled event sequence number, change type is determined by comparing the serialized value of each instance — keyed by its id property — against the previous window.

Methods

Diff(IEnumerable<object>)

Diff the given window of instances against the previous window.

public IReadOnlyList<MaterializedReadModelChange> Diff(IEnumerable<object> window)

Parameters

window IEnumerable<object>

The current window of read model instances.

Returns

IReadOnlyList<MaterializedReadModelChange>

The changes between the previous window and this one.