Skip to content

Event sources in the .NET client

This page covers the .NET client’s API for event source definitions. The guides, the scenarios and the explanation of how they work are in Event sources and streams. This page lists the client types and where each is explained. An event source is optional: the existing append APIs remain valid and append events without a definition.

TypePurposeExplained in
IEventSourceMarker interface. A class that implements it is a definitionDefine an event source
[EventSource]Names the definition and sets its description and default ConcurrencyDefine an event source
[EventStream]Declares a stream, with its own description and Concurrency. Repeat it for each streamDefine an event source
ConcurrencyDimensionsFlags that choose which values take part in an append’s concurrency checkConcurrency
Append<TSource>, AppendMany<TSource>, AppendPrepared<TSource>Extension methods on IEventSequenceAppend through a definition
EventForEventSourceId.EventSource and .EventStreamRoute one event of a multi-source batch through a definitionAppend through a definition
ConcurrencyScopeBuilder.ForEventSource<TSource>Builds an explicit scope from a definition’s namesConcurrency
[FromEventSource<TSource>]Filters a reactor or reducer to one streamFilter observers
IEventStore.EventSources and IEventSourcesAll, GetFor(Type) and GetFor(string) return the discovered EventSourceDefinition recordsDefine an event source
IClientArtifactsProvider.EventSourcesThe types the client treats as definitionsHow it works
ExceptionThrown when
DuplicateEventSourceNameTwo definitions share a name
DuplicateEventStreamNameA definition declares a stream twice
UnknownEventSourceA type or name is not a discovered definition
EventStreamDoesNotBelongToEventSourceA stream name is not declared by the definition
EventRoutingContradictsEventSourceAn explicit event source type or stream type contradicts the definition
IncompatibleConcurrencyScopesForEventSourceA batch needs different guards for one event source id. See Concurrency
EventSourcesNotSupportedAn IEventStore or IEventSequence implementation does not support event sources, such as a custom test double

With explicit artifact registration you nominate the definitions in the composition root. A nominated event source keeps its declared streams and metadata, and an explicit name changes the registered identity only.