Class EventStreamEntry
- Namespace
- Stratara.Abstractions.EventSourcing
- Assembly
- Stratara.Abstractions.dll
Event stream entry persisted in the write store. One row per appended event.
[ExcludeFromCodeCoverage]
public sealed class EventStreamEntry : IEntity, IMultiTenant, IBucket, IHasRowVersion
- Inheritance
-
EventStreamEntry
- Implements
- Inherited Members
- Extension Methods
Remarks
Identity convention: TenantId + UserId identify the data owner (Subject — uniform with TenantId on every other entity); ActorTenantId + ActorUserId identify the principal who triggered the write (Actor — audit trail). They differ only for PlatformAdmin cross-tenant operations and system / saga flows.
Properties
ActorTenantId
Actor — the tenant that triggered the write (PlatformAdmin's home tenant in cross-tenant flows).
public required Guid ActorTenantId { get; set; }
Property Value
ActorUserId
Actor — the user that triggered the write.
public required Guid ActorUserId { get; set; }
Property Value
AggregateTypeName
Fully-qualified, version-independent type name of the owning aggregate.
public required string AggregateTypeName { get; set; }
Property Value
BucketId
The bucket index in [0, BucketCount).
public required int BucketId { get; set; }
Property Value
CausationId
Id of the command that caused this event — set by the command-audit pipeline behaviour.
public string? CausationId { get; set; }
Property Value
CorrelationId
Cross-service correlation id propagated from the originating request.
public string? CorrelationId { get; set; }
Property Value
DataJson
Serialised event payload as JSON.
public required string DataJson { get; set; }
Property Value
EventTypeName
Fully-qualified, version-independent type name of the event payload.
public required string EventTypeName { get; set; }
Property Value
Hash
Hash of this entry; null until the hash worker fills it in.
public byte[]? Hash { get; set; }
Property Value
- byte[]
Id
The entity's primary-key identifier.
public Guid Id { get; set; }
Property Value
PreviousHash
Hash of the preceding stream entry; null until the hash worker fills it in.
public byte[]? PreviousHash { get; set; }
Property Value
- byte[]
RowVersion
Current row version as read from xmin. Set by EF Core on save.
public uint RowVersion { get; set; }
Property Value
SequenceNumber
Global sequence number — monotonically increasing across all streams.
public long SequenceNumber { get; set; }
Property Value
StreamId
Id of the stream the entry belongs to (= aggregate id).
public required Guid StreamId { get; set; }
Property Value
TenantId
Subject (data-owner) tenant id — uniform with TenantId.
public required Guid TenantId { get; set; }
Property Value
Timestamp
When the event was appended.
public DateTimeOffset Timestamp { get; set; }
Property Value
UserId
Subject (data-owner) user id — only meaningful for user-aggregates; null otherwise.
public Guid? UserId { get; set; }
Property Value
- Guid?
Version
Aggregate-relative version. 1 is the creation event.
public required long Version { get; set; }