Class EventStreamContiguityException
- Namespace
- Excalibur.Domain.Exceptions
- Assembly
- Excalibur.Domain.dll
Thrown when an aggregate's event stream is not contiguous during rehydration — a replayed event's version is not exactly one greater than the previously applied version. Enforces that history is replayed gap-free and in order, rather than inferring the version by counting events (which silently applies the wrong event where a missing one belongs and rehydrates a corrupt aggregate).
public sealed class EventStreamContiguityException : DomainException, ISerializable
- Inheritance
-
EventStreamContiguityException
- Implements
- Inherited Members
Constructors
EventStreamContiguityException()
Initializes a new instance of the EventStreamContiguityException class with a default message.
public EventStreamContiguityException()
EventStreamContiguityException(string)
Initializes a new instance of the EventStreamContiguityException class with a specified message.
public EventStreamContiguityException(string message)
Parameters
messagestringA message describing the exception.
EventStreamContiguityException(string, Exception?)
Initializes a new instance of the EventStreamContiguityException class with a specified message and inner exception.
public EventStreamContiguityException(string message, Exception? innerException)
Parameters
messagestringA message describing the exception.
innerExceptionExceptionThe exception that caused the current exception.
EventStreamContiguityException(Type, long, long)
Initializes a new instance of the EventStreamContiguityException class.
public EventStreamContiguityException(Type aggregateType, long expectedVersion, long actualVersion)
Parameters
aggregateTypeTypeThe aggregate type being rehydrated.
expectedVersionlongThe version the next event was required to have.
actualVersionlongThe version the next event actually had.
Properties
ActualVersion
Gets the version the next event actually had.
public long ActualVersion { get; }
Property Value
- long
The actual version.
AggregateType
Gets the aggregate type being rehydrated, if known.
public Type? AggregateType { get; }
Property Value
ExpectedVersion
Gets the version the next event was required to have.
public long ExpectedVersion { get; }
Property Value
- long
The expected version.