Skip to main content
Table of Contents

Class Event<TEvent>

Namespace
Stratara.Shared.EventSourcing
Assembly
Stratara.Shared.dll

Concrete implementation of IEvent<TEvent> that wraps a strongly-typed event payload together with the stream identity, version, and tenant / actor context required by the event store.

public sealed record Event<TEvent> : IEvent<TEvent>, IEvent, IEquatable<Event<TEvent>> where TEvent : notnull

Type Parameters

TEvent

CLR type of the wrapped event payload.

Inheritance
Event<TEvent>
Implements
IEvent<TEvent>
IEquatable<Event<TEvent>>
Inherited Members
Extension Methods

Constructors

Event(Guid, long, TEvent, Guid, Guid, Guid, string)

Concrete implementation of IEvent<TEvent> that wraps a strongly-typed event payload together with the stream identity, version, and tenant / actor context required by the event store.

public Event(Guid Id, long Version, TEvent Data, Guid StreamId, Guid TenantId, Guid UserId, string AggregateTypeName = "Unknown")

Parameters

Id Guid

Stable event id (also the event-store row id).

Version long

Monotonic version of the event within its stream.

Data TEvent

The typed event payload.

StreamId Guid

Id of the event stream / aggregate the event belongs to.

TenantId Guid

Data-owner tenant the event belongs to.

UserId Guid

Actor user id that produced the event (used in audit surfaces).

AggregateTypeName string

CLR type name of the aggregate whose state the event mutates.

Properties

AggregateTypeName

CLR type name of the aggregate whose state the event mutates.

public string AggregateTypeName { get; init; }

Property Value

string

Data

The typed event payload.

public TEvent Data { get; init; }

Property Value

TEvent

EventTypeName

Fully-qualified, version-independent type name of the event payload.

public string EventTypeName { get; }

Property Value

string

Id

Stable event id (also the event-store row id).

public Guid Id { get; init; }

Property Value

Guid

StreamId

Id of the event stream / aggregate the event belongs to.

public Guid StreamId { get; init; }

Property Value

Guid

TenantId

Data-owner tenant the event belongs to.

public Guid TenantId { get; init; }

Property Value

Guid

UserId

Actor user id that produced the event (used in audit surfaces).

public Guid UserId { get; init; }

Property Value

Guid

Version

Monotonic version of the event within its stream.

public long Version { get; init; }

Property Value

long