Class DecisionConflict

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

A concurrency conflict for a protected read.

public record DecisionConflict : IEquatable<DecisionConflict>
Inheritance
DecisionConflict
Implements
Inherited Members
Extension Methods

Remarks

A conflict can be returned as a response body: System.Text.Json writes the read model's identifier, the Key and the conflicting event, if known, as plain values, with or without concept converters registered. The CLR ReadModelType is not serialized.

Constructors

DecisionConflict(DecisionConflict)

protected DecisionConflict(DecisionConflict original)

Parameters

original DecisionConflict

DecisionConflict(Type, ReadModelKey)

A concurrency conflict for a protected read.

public DecisionConflict(Type ReadModelType, ReadModelKey Key)

Parameters

ReadModelType Type

The read model that changed.

Key ReadModelKey

The key that changed.

Remarks

A conflict can be returned as a response body: System.Text.Json writes the read model's identifier, the Key and the conflicting event, if known, as plain values, with or without concept converters registered. The CLR ReadModelType is not serialized.

Properties

ConflictingEventSequenceNumber

Gets the EventSequenceNumber of the first event matching the decision's guard after the read, if known. Reads that share a guard are merged, so it can belong to another read under the same guard.

[JsonConverter(typeof(ConceptAsJsonConverterFactory))]
public EventSequenceNumber? ConflictingEventSequenceNumber { get; init; }

Property Value

EventSequenceNumber

Remarks

Null when the conflict was not caused by a reported concurrency violation, or the kernel did not report the event.

ConflictingEventTypeId

Gets the EventTypeId of the first event matching the decision's guard after the read, if known. Reads that share a guard are merged, so it can belong to another read under the same guard.

[JsonConverter(typeof(ConceptAsJsonConverterFactory))]
public EventTypeId? ConflictingEventTypeId { get; init; }

Property Value

EventTypeId

Remarks

Null when the conflict was not caused by a reported concurrency violation, or the kernel did not report the event.

EqualityContract

protected virtual Type EqualityContract { get; }

Property Value

Type

Key

The key that changed.

[JsonConverter(typeof(ConceptAsJsonConverterFactory))]
public ReadModelKey Key { get; init; }

Property Value

ReadModelKey

ReadModel

Gets the ReadModelIdentifier of the read model that changed.

[JsonConverter(typeof(ConceptAsJsonConverterFactory))]
public ReadModelIdentifier ReadModel { get; }

Property Value

ReadModelIdentifier

ReadModelType

The read model that changed.

[JsonIgnore]
public Type ReadModelType { get; init; }

Property Value

Type

Methods

Deconstruct(out Type, out ReadModelKey)

public void Deconstruct(out Type ReadModelType, out ReadModelKey Key)

Parameters

ReadModelType Type
Key ReadModelKey

Equals(DecisionConflict?)

public virtual bool Equals(DecisionConflict? other)

Parameters

other DecisionConflict

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

PrintMembers(StringBuilder)

protected virtual bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

ToString()

public override string ToString()

Returns

string

Operators

operator ==(DecisionConflict?, DecisionConflict?)

public static bool operator ==(DecisionConflict? left, DecisionConflict? right)

Parameters

left DecisionConflict
right DecisionConflict

Returns

bool

operator !=(DecisionConflict?, DecisionConflict?)

public static bool operator !=(DecisionConflict? left, DecisionConflict? right)

Parameters

left DecisionConflict
right DecisionConflict

Returns

bool