Interface IEventSourceOperations
- Assembly
- Cratis.Chronicle.dll
Defines operations related to a specific event source within an event sequence.
public interface IEventSourceOperations
- Extension Methods
Properties
ConcurrencyScope
Gets the concurrency scope for the operations.
ConcurrencyScope ConcurrencyScope { get; }
Property Value
Operations
Gets the operations associated with the event source.
IEnumerable<IEventSequenceOperation> Operations { get; }
Property Value
Methods
Append(object, Causation?, EventStreamType?, EventStreamId?, EventSourceType?, IEnumerable<string>?, DateTimeOffset?, Subject?)
Appends an event to the operation.
EventSourceOperations Append(object @event, Causation? causation = null, EventStreamType? eventStreamType = null, EventStreamId? eventStreamId = null, EventSourceType? eventSourceType = null, IEnumerable<string>? tags = null, DateTimeOffset? occurred = null, Subject? subject = null)
Parameters
eventobjectThe event to append.
causationCausationOptional causation for the event.
eventStreamTypeEventStreamTypeOptional The type of event stream.
eventStreamIdEventStreamIdOptional The identifier for the event stream.
eventSourceTypeEventSourceTypeOptional The type of event source.
tagsIEnumerable<string>Optional dynamic tags to associate with the event.
occurredDateTimeOffset?Optional timestamp for when the event occurred.
subjectSubjectOptional subject identifying what the event is about.
Returns
- EventSourceOperations
The current instance of EventSourceOperations.
GetAppendedEvents()
Gets the events that have been appended in the operation builders.
IEnumerable<object> GetAppendedEvents()
Returns
- IEnumerable<object>
Collection of events.
GetOperationsOfType<T>()
Gets the operations of a specific type.
IEnumerable<T> GetOperationsOfType<T>() where T : IEventSequenceOperation
Returns
- IEnumerable<T>
Collection of operations of the specified type.
Type Parameters
TThe type of operations to retrieve.
WithConcurrencyScope(ConcurrencyScope)
Configures the concurrency scope for the operations with a specific scope.
EventSourceOperations WithConcurrencyScope(ConcurrencyScope concurrencyScope)
Parameters
concurrencyScopeConcurrencyScopeThe concurrency scope to set.
Returns
- EventSourceOperations
The current instance of EventSourceOperations.
Remarks
A NotSet value does not override a scope that has already been set for the event source, so that a later event added without a scope cannot silently disable the concurrency check. A non-NotSet value overrides any previously set scope.
WithConcurrencyScope(Action<ConcurrencyScopeBuilder>)
Configures the concurrency scope for the operations.
EventSourceOperations WithConcurrencyScope(Action<ConcurrencyScopeBuilder> configure)
Parameters
configureAction<ConcurrencyScopeBuilder>Action to configure the concurrency scope.
Returns
- EventSourceOperations
The current instance of EventSourceOperations.