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
TEventThe closing event type.
- Inheritance
-
ClosesStreamBuilder<TEvent>
- Implements
-
IClosesStreamBuilder<TEvent>
- 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
eventTypesIEventTypesThe event types and schemas.
namingPolicyINamingPolicyThe 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
nameConstraintNameThe 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
propertyExpression<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
TReopenThe reopening event type.