Skip to content

Class DomainEvent

Namespace: Cephalon.Abstractions.EventSourcing
Assembly: Cephalon.Abstractions.dll

Provides a minimal record base for immutable domain events.

public abstract record DomainEvent : IDomainEvent, IEquatable<DomainEvent>

objectDomainEvent

IDomainEvent, IEquatable<DomainEvent>

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Initializes a new instance of the record.

protected DomainEvent(string streamId, long streamVersion, DateTime occurredAtUtc)

streamId string

The stable stream identifier that owns the event.

streamVersion long

The optimistic stream version assigned to the event.

occurredAtUtc DateTime

The time at which the event occurred in UTC.

Gets the time at which the event occurred in UTC.

public DateTime OccurredAtUtc { get; init; }

DateTime

Gets the stable stream identifier that owns the event.

public string StreamId { get; init; }

string

Gets the optimistic stream version assigned to the event.

public long StreamVersion { get; init; }

long