Table of Contents

Class ErasedEventMarker

Namespace
Excalibur.EventSourcing
Assembly
Excalibur.EventSourcing.Abstractions.dll

Defines the framework-controlled marker that identifies a GDPR-erased (tombstoned) event in an event store.

public static class ErasedEventMarker
Inheritance
ErasedEventMarker
Inherited Members

Remarks

GDPR Article 17 erasure tombstones an aggregate's events in place: each event's payload is nulled (or replaced) and its EventType is overwritten with EventType while the stream sequence is preserved. The marker is a closed, framework-owned discriminator -- never a user event type -- so the erased state can be recognized structurally (a positive marker check) rather than heuristically (treating a deserialization failure as erasure, which would mask genuine corruption).

This constant is the single source of truth for the tombstone marker. Event store and erasure implementations (IEventStoreErasure) MUST write and recognize this exact value so that rehydration (e.g. EventSourcedRepository.GetByIdAsync) can distinguish an erased stream from a corrupt one.

Fields

EventType

The reserved EventType value written in place of an erased event's original type. Aggregate rehydration recognizes this marker positively (before any deserialization attempt) and returns a defined erased sentinel rather than failing loud.

public const string EventType = "$erased"

Field Value

string

Methods

IsErased(string?)

Determines whether a stored event's type name is the erasure tombstone marker.

public static bool IsErased(string? eventType)

Parameters

eventType string

The stored event's EventType value.

Returns

bool

true when the value is exactly EventType; otherwise false.

Remarks

Every reader of a stored event stream calls this before attempting to resolve or deserialize the event, so an erased event is recognized by its marker rather than by the failure it would otherwise cause. The comparison is ordinal and exact: only the reserved marker matches, so a genuinely corrupt or unregistered event type is never mistaken for an erasure.