Table of Contents

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

message string

A 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

message string

A message describing the exception.

innerException Exception

The 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

aggregateType Type

The aggregate type being rehydrated.

expectedVersion long

The version the next event was required to have.

actualVersion long

The 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

Type

The aggregate type, or null when constructed without one.

ExpectedVersion

Gets the version the next event was required to have.

public long ExpectedVersion { get; }

Property Value

long

The expected version.