Class ClosesStreamBuilder<TEvent>

Namespace
Cratis.Chronicle.Events.Constraints
Assembly
Cratis.Chronicle.dll

Builds one closing-event declaration with an optional property-sourced stream identifier.

public class ClosesStreamBuilder<TEvent> : IClosesStreamBuilder<TEvent>

Type Parameters

TEvent

The closing event type.

Inheritance
ClosesStreamBuilder<TEvent>
Implements
Inherited Members
Extension Methods

Constructors

ClosesStreamBuilder(IEventTypes, INamingPolicy)

Builds one closing-event declaration with an optional property-sourced stream identifier.

public ClosesStreamBuilder(IEventTypes eventTypes, INamingPolicy namingPolicy)

Parameters

eventTypes IEventTypes

The event types and schemas.

namingPolicy INamingPolicy

The payload naming policy.

Methods

Build(ConstraintName)

Build the declaration and verify its property on every closing and reopening event.

public ClosesStreamConstraintDefinition Build(ConstraintName name)

Parameters

name ConstraintName

The owner name.

Returns

ClosesStreamConstraintDefinition

The closing declaration.

Exceptions

PropertyDoesNotExistOnEventType

A participating event lacks the property.

MissingNameForClosesStreamConstraint

The name is reserved for manual closures.

EventStreamIdFrom(Expression<Func<TEvent, object?>>)

Resolve the stream identifier from the payload instead of the append's stream metadata.

public IClosesStreamBuilder<TEvent> EventStreamIdFrom(Expression<Func<TEvent, object?>> property)

Parameters

property Expression<Func<TEvent, object>>

The property carrying the stream identifier.

Returns

IClosesStreamBuilder<TEvent>

The builder for continuation.

PerEventSourceId()

Include the event source identifier.

public IClosesStreamBuilder<TEvent> PerEventSourceId()

Returns

IClosesStreamBuilder<TEvent>

The builder for continuation.

PerEventSourceType()

Include the event source type.

public IClosesStreamBuilder<TEvent> PerEventSourceType()

Returns

IClosesStreamBuilder<TEvent>

The builder for continuation.

PerEventStreamId()

Include the stream identifier.

public IClosesStreamBuilder<TEvent> PerEventStreamId()

Returns

IClosesStreamBuilder<TEvent>

The builder for continuation.

PerEventStreamType()

Include the stream type.

public IClosesStreamBuilder<TEvent> PerEventStreamType()

Returns

IClosesStreamBuilder<TEvent>

The builder for continuation.

ReopenedBy<TReopen>()

Declare an event type that reopens this constraint's exact scope.

public IClosesStreamBuilder<TEvent> ReopenedBy<TReopen>()

Returns

IClosesStreamBuilder<TEvent>

The builder for continuation.

Type Parameters

TReopen

The reopening event type.