Class ConcurrencyViolation
- Assembly
- Cratis.Chronicle.dll
Represents a concurrency violation that occurred during an append operation.
public record ConcurrencyViolation : IEquatable<ConcurrencyViolation>
- Inheritance
-
ConcurrencyViolation
- Implements
- Inherited Members
- Extension Methods
Constructors
ConcurrencyViolation(ConcurrencyViolation)
protected ConcurrencyViolation(ConcurrencyViolation original)
Parameters
originalConcurrencyViolation
ConcurrencyViolation(EventSourceId, EventSequenceNumber, EventSequenceNumber)
Represents a concurrency violation that occurred during an append operation.
public ConcurrencyViolation(EventSourceId EventSourceId, EventSequenceNumber ExpectedEventSequenceNumber, EventSequenceNumber ActualEventSequenceNumber)
Parameters
EventSourceIdEventSourceIdThe EventSourceId of the event source where the violation occurred.
ExpectedEventSequenceNumberEventSequenceNumberThe expected EventSequenceNumber.
ActualEventSequenceNumberEventSequenceNumberThe actual EventSequenceNumber.
Properties
ActualEventSequenceNumber
The actual EventSequenceNumber.
public EventSequenceNumber ActualEventSequenceNumber { get; init; }
Property Value
ConflictingEventSequenceNumber
Gets the EventSequenceNumber of the first event that caused the violation, if the kernel reported it.
public EventSequenceNumber? ConflictingEventSequenceNumber { get; init; }
Property Value
Remarks
This is the first event matching the concurrency scope after the expected sequence number. It is null when the kernel is older than this client or could not read the event.
ConflictingEventTypeId
Gets the EventTypeId of the first event that caused the violation, if the kernel reported it.
public EventTypeId? ConflictingEventTypeId { get; init; }
Property Value
Remarks
This is the first event matching the concurrency scope after the expected sequence number. It is null when the kernel is older than this client or could not read the event.
EqualityContract
protected virtual Type EqualityContract { get; }
Property Value
EventSourceId
The EventSourceId of the event source where the violation occurred.
public EventSourceId EventSourceId { get; init; }
Property Value
ExpectedEventSequenceNumber
The expected EventSequenceNumber.
public EventSequenceNumber ExpectedEventSequenceNumber { get; init; }
Property Value
Scope
Gets the predicate and expected boundary that failed, when reported.
public ConcurrencyScope? Scope { get; init; }
Property Value
ScopeIndex
Gets the failed scope's zero-based position in the request sent by the client, after de-duplication and resolution, when reported.
public uint? ScopeIndex { get; init; }
Property Value
- uint?
Methods
Deconstruct(out EventSourceId, out EventSequenceNumber, out EventSequenceNumber)
public void Deconstruct(out EventSourceId EventSourceId, out EventSequenceNumber ExpectedEventSequenceNumber, out EventSequenceNumber ActualEventSequenceNumber)
Parameters
EventSourceIdEventSourceIdExpectedEventSequenceNumberEventSequenceNumberActualEventSequenceNumberEventSequenceNumber
Equals(ConcurrencyViolation?)
public virtual bool Equals(ConcurrencyViolation? other)
Parameters
otherConcurrencyViolation
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 ==(ConcurrencyViolation?, ConcurrencyViolation?)
public static bool operator ==(ConcurrencyViolation? left, ConcurrencyViolation? right)
Parameters
leftConcurrencyViolationrightConcurrencyViolation
Returns
operator !=(ConcurrencyViolation?, ConcurrencyViolation?)
public static bool operator !=(ConcurrencyViolation? left, ConcurrencyViolation? right)
Parameters
leftConcurrencyViolationrightConcurrencyViolation