Class DecisionModel<TState>
- Namespace
- Opossum.DecisionModel
- Assembly
- Opossum.dll
The result of building a Decision Model via BuildDecisionModelAsync<TState>(IEventStore, IDecisionProjection<TState>, CancellationToken).
public sealed record DecisionModel<TState> : IEquatable<DecisionModel<TState>>
Type Parameters
TStateThe type of the decision model state.
- Inheritance
-
DecisionModel<TState>
- Implements
-
IEquatable<DecisionModel<TState>>
- Inherited Members
Remarks
State is the accumulated projection state built by folding all relevant events from the event store.
AppendCondition must be passed to AppendAsync(NewEvent[], AppendCondition?, CancellationToken) to enforce the Dynamic Consistency Boundary: if any event matching the projection query was appended between the read and the append, the operation is rejected and the command handler should retry.
Constructors
DecisionModel(TState, AppendCondition)
The result of building a Decision Model via BuildDecisionModelAsync<TState>(IEventStore, IDecisionProjection<TState>, CancellationToken).
public DecisionModel(TState State, AppendCondition AppendCondition)
Parameters
StateTStateThe projected state built from all relevant events.
AppendConditionAppendConditionThe guard that ties this decision model to a specific position in the event stream. Pass this to AppendAsync(NewEvent[], AppendCondition?, CancellationToken) unchanged.
Remarks
State is the accumulated projection state built by folding all relevant events from the event store.
AppendCondition must be passed to AppendAsync(NewEvent[], AppendCondition?, CancellationToken) to enforce the Dynamic Consistency Boundary: if any event matching the projection query was appended between the read and the append, the operation is rejected and the command handler should retry.
Properties
AppendCondition
The guard that ties this decision model to a specific position in the event stream. Pass this to AppendAsync(NewEvent[], AppendCondition?, CancellationToken) unchanged.
public AppendCondition AppendCondition { get; init; }
Property Value
State
The projected state built from all relevant events.
public TState State { get; init; }
Property Value
- TState