Table of Contents

Class DecisionModel<TState>

Namespace
Opossum.DecisionModel
Assembly
Opossum.dll
public sealed record DecisionModel<TState> : IEquatable<DecisionModel<TState>>

Type Parameters

TState

The type of the decision model state.

Inheritance
DecisionModel<TState>
Implements
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)

public DecisionModel(TState State, AppendCondition AppendCondition)

Parameters

State TState

The projected state built from all relevant events.

AppendCondition AppendCondition

The 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

AppendCondition

State

The projected state built from all relevant events.

public TState State { get; init; }

Property Value

TState