Class EventMessage
Wire-level representation of a single event that occurred on an aggregate stream. Carries enough metadata for projection / saga workers to reconstruct the event without database access.
[ExcludeFromCodeCoverage]
public sealed record EventMessage : IEquatable<EventMessage>
- Inheritance
-
EventMessage
- Implements
- Inherited Members
- Extension Methods
Remarks
Property names are pinned via JsonPropertyNameAttribute so the wire format is independent of
any consumer-side JsonSerializerOptions.PropertyNamingPolicy.
Constructors
EventMessage(Guid, long, string, Guid, string, string, Guid, Guid, Guid, Guid?)
Wire-level representation of a single event that occurred on an aggregate stream. Carries enough metadata for projection / saga workers to reconstruct the event without database access.
public EventMessage(Guid Id, long Version, string DataJson, Guid StreamId, string EventTypeName, string AggregateTypeName, Guid ActorTenantId, Guid ActorUserId, Guid TenantId, Guid? UserId)
Parameters
IdGuidEvent identifier (typically a sortable v7 GUID).
VersionlongAggregate-stream version this event sits at (1-based).
DataJsonstringJSON serialization of the event's payload.
StreamIdGuidIdentifier of the aggregate stream this event belongs to.
EventTypeNamestringVersion-independent type name used to resolve the concrete event type.
AggregateTypeNamestringVersion-independent type name of the aggregate the event was written against.
ActorTenantIdGuidTenant id of the principal that triggered the write (audit dimension).
ActorUserIdGuidUser id of the principal that triggered the write (audit dimension).
TenantIdGuidTenant the data belongs to (data-owner dimension; used for routing and AAD).
UserIdGuid?Optional user the data belongs to (null for tenant-scoped aggregates).
Remarks
Property names are pinned via JsonPropertyNameAttribute so the wire format is independent of
any consumer-side JsonSerializerOptions.PropertyNamingPolicy.
Properties
ActorTenantId
Tenant id of the principal that triggered the write (audit dimension).
[JsonPropertyName("ActorTenantId")]
public Guid ActorTenantId { get; init; }
Property Value
ActorUserId
User id of the principal that triggered the write (audit dimension).
[JsonPropertyName("ActorUserId")]
public Guid ActorUserId { get; init; }
Property Value
AggregateTypeName
Version-independent type name of the aggregate the event was written against.
[JsonPropertyName("AggregateTypeName")]
public string AggregateTypeName { get; init; }
Property Value
DataJson
JSON serialization of the event's payload.
[JsonPropertyName("DataJson")]
public string DataJson { get; init; }
Property Value
EventTypeName
Version-independent type name used to resolve the concrete event type.
[JsonPropertyName("EventTypeName")]
public string EventTypeName { get; init; }
Property Value
Id
Event identifier (typically a sortable v7 GUID).
[JsonPropertyName("Id")]
public Guid Id { get; init; }
Property Value
StreamId
Identifier of the aggregate stream this event belongs to.
[JsonPropertyName("StreamId")]
public Guid StreamId { get; init; }
Property Value
TenantId
Tenant the data belongs to (data-owner dimension; used for routing and AAD).
[JsonPropertyName("TenantId")]
public Guid TenantId { get; init; }
Property Value
UserId
Optional user the data belongs to (null for tenant-scoped aggregates).
[JsonPropertyName("UserId")]
public Guid? UserId { get; init; }
Property Value
- Guid?
Version
Aggregate-stream version this event sits at (1-based).
[JsonPropertyName("Version")]
public long Version { get; init; }