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
originalDecisionConflict
DecisionConflict(Type, ReadModelKey)
A concurrency conflict for a protected read.
public DecisionConflict(Type ReadModelType, ReadModelKey Key)
Parameters
ReadModelTypeTypeThe read model that changed.
KeyReadModelKeyThe 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
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
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
Key
The key that changed.
[JsonConverter(typeof(ConceptAsJsonConverterFactory))]
public ReadModelKey Key { get; init; }
Property Value
ReadModel
Gets the ReadModelIdentifier of the read model that changed.
[JsonConverter(typeof(ConceptAsJsonConverterFactory))]
public ReadModelIdentifier ReadModel { get; }
Property Value
ReadModelType
The read model that changed.
[JsonIgnore]
public Type ReadModelType { get; init; }
Property Value
Methods
Deconstruct(out Type, out ReadModelKey)
public void Deconstruct(out Type ReadModelType, out ReadModelKey Key)
Parameters
ReadModelTypeTypeKeyReadModelKey
Equals(DecisionConflict?)
public virtual bool Equals(DecisionConflict? other)
Parameters
otherDecisionConflict
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
PrintMembers(StringBuilder)
protected virtual bool PrintMembers(StringBuilder builder)
Parameters
builderStringBuilder
Returns
ToString()
public override string ToString()
Returns
Operators
operator ==(DecisionConflict?, DecisionConflict?)
public static bool operator ==(DecisionConflict? left, DecisionConflict? right)
Parameters
leftDecisionConflictrightDecisionConflict
Returns
operator !=(DecisionConflict?, DecisionConflict?)
public static bool operator !=(DecisionConflict? left, DecisionConflict? right)
Parameters
leftDecisionConflictrightDecisionConflict