Skip to main content
Table of Contents

Interface IProjection

Namespace
Stratara.Projections.Abstractions
Assembly
Stratara.Projections.dll

Marker interface for a Stratara projection (a read-model writer that reacts to events flowing through the event bundle). Implementations declare one or more HandleAsync(TEvent, CancellationToken) methods — public or private — that the ProjectionMethodInvoker discovers via reflection.

public interface IProjection
Extension Methods

Remarks

Projections are registered as scoped services. A new instance is resolved per event bundle, so cross-bundle state must be persisted in the read store. Handler methods may accept either the event payload type (HandleAsync(MyEvent, CancellationToken)) or the wrapping IEvent<MyEvent> when access to metadata (StreamId, Version, …) is required. Mark handler methods with [JetBrains.Annotations.UsedImplicitly] to suppress unused-member warnings.