Class AppendManyResult
- Namespace
- Cratis.Chronicle.EventSequences
- Assembly
- Cratis.Chronicle.dll
Represents the result of an append many operation.
public record AppendManyResult : IAppendResult, IAppendResultForObserverCompletion, IEquatable<AppendManyResult>
- Inheritance
-
AppendManyResult
- Implements
- Inherited Members
- Extension Methods
Constructors
AppendManyResult()
public AppendManyResult()
AppendManyResult(AppendManyResult)
protected AppendManyResult(AppendManyResult original)
Parameters
originalAppendManyResult
Properties
AllAlreadyAppended
Gets a value indicating whether every event was already in the sequence, so this call wrote nothing.
public bool AllAlreadyAppended { get; }
Property Value
ConcurrencyCheckPerformed
Gets a value indicating whether the concurrency check was actually performed for the operation.
public bool ConcurrencyCheckPerformed { get; init; }
Property Value
Remarks
A skipped concurrency check looks from the outside exactly like a passing one - the append succeeds either way - so this is the only way for a caller to tell whether the serialization it believes it has was enforced. False means nothing was compared against the event store: the operation either asked for no check (None), carried no scope at all, or declared a scope with no expectation the kernel could validate (IsIncomplete). The first append into a scope reports false unless the first-append check is opted into - see CheckFirstAppendIntoAScope.
ConcurrencyViolations
Gets any concurrency violations that occurred during the operation.
public IEnumerable<ConcurrencyViolation> ConcurrencyViolations { get; init; }
Property Value
ConstraintViolations
Gets any violations that occurred during the operation.
public IEnumerable<ConstraintViolation> ConstraintViolations { get; init; }
Property Value
CorrelationId
Gets the CorrelationId for the operation.
public CorrelationId CorrelationId { get; init; }
Property Value
EqualityContract
protected virtual Type EqualityContract { get; }
Property Value
Errors
Gets any exception messages that might have occurred.
public IEnumerable<AppendError> Errors { get; init; }
Property Value
EventSequenceId
Gets the event sequence that the append operation targeted.
public EventSequenceId EventSequenceId { get; }
Property Value
EventStore
Gets the event store where the append operation happened.
public EventStoreName EventStore { get; }
Property Value
EventStoreNamespace
Gets the event store namespace where the append operation happened.
public EventStoreNamespaceName EventStoreNamespace { get; }
Property Value
EventTypes
Gets the event types appended by this operation. Empty retains the legacy wait-for-all behavior.
public IEnumerable<EventType> EventTypes { get; init; }
Property Value
HasConcurrencyViolations
Gets whether or not there are any concurrency violations that occurred.
public bool HasConcurrencyViolations { get; }
Property Value
HasConstraintViolations
Gets whether or not there are any violations that occurred.
public bool HasConstraintViolations { get; }
Property Value
HasErrors
Gets whether or not there are any errors that occurred.
public bool HasErrors { get; }
Property Value
HasIdempotencyConflicts
Gets a value indicating whether any idempotency key was refused.
public bool HasIdempotencyConflicts { get; }
Property Value
IdempotencyConflicts
Gets the idempotency keys that were refused because they already identify a different event.
public IEnumerable<IdempotencyKeyConflict> IdempotencyConflicts { get; init; }
Property Value
IsSuccess
Gets a value indicating whether the operation was successful.
public bool IsSuccess { get; }
Property Value
Outcomes
Gets what the append did for each event, aligned with SequenceNumbers. Every entry is Appended for an unkeyed append.
public IEnumerable<AppendOutcome> Outcomes { get; init; }
Property Value
SequenceNumbers
Gets the sequence numbers of the events that were appended, if successful. In the same sequence as the events were provided.
public IEnumerable<EventSequenceNumber> SequenceNumbers { get; init; }
Property Value
TailSequenceNumber
Gets the last event sequence number represented by the append operation.
public EventSequenceNumber TailSequenceNumber { get; }
Property Value
Methods
Equals(AppendManyResult?)
public virtual bool Equals(AppendManyResult? other)
Parameters
otherAppendManyResult
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
Failed(CorrelationId, IEnumerable<AppendError>)
Create a failed result with errors.
public static AppendManyResult Failed(CorrelationId correlationId, IEnumerable<AppendError> errors)
Parameters
correlationIdCorrelationIdCorrelationId for the operation.
errorsIEnumerable<AppendError>The errors.
Returns
- AppendManyResult
A new failed AppendManyResult instance.
Failed(CorrelationId, IEnumerable<ConcurrencyViolation>)
Create a failed result with concurrency violations.
public static AppendManyResult Failed(CorrelationId correlationId, IEnumerable<ConcurrencyViolation> violations)
Parameters
correlationIdCorrelationIdCorrelationId for the operation.
violationsIEnumerable<ConcurrencyViolation>The ConcurrencyViolation instances that occurred.
Returns
- AppendManyResult
A new failed AppendManyResult instance.
Failed(CorrelationId, IEnumerable<ConstraintViolation>)
Create a failed result with constraint violations.
public static AppendManyResult Failed(CorrelationId correlationId, IEnumerable<ConstraintViolation> violations)
Parameters
correlationIdCorrelationIdCorrelationId for the operation.
violationsIEnumerable<ConstraintViolation>The violations.
Returns
- AppendManyResult
A new failed AppendManyResult instance.
GetHashCode()
public override int GetHashCode()
Returns
PrintMembers(StringBuilder)
protected virtual bool PrintMembers(StringBuilder builder)
Parameters
builderStringBuilder
Returns
Success(CorrelationId, IEnumerable<EventSequenceNumber>)
Create a successful result.
public static AppendManyResult Success(CorrelationId correlationId, IEnumerable<EventSequenceNumber> sequenceNumbers)
Parameters
correlationIdCorrelationIdCorrelationId for the operation.
sequenceNumbersIEnumerable<EventSequenceNumber>Collection of EventSequenceNumber to report.
Returns
- AppendManyResult
A new AppendResult instance.
ToString()
public override string ToString()
Returns
Operators
operator ==(AppendManyResult?, AppendManyResult?)
public static bool operator ==(AppendManyResult? left, AppendManyResult? right)
Parameters
leftAppendManyResultrightAppendManyResult
Returns
operator !=(AppendManyResult?, AppendManyResult?)
public static bool operator !=(AppendManyResult? left, AppendManyResult? right)
Parameters
leftAppendManyResultrightAppendManyResult