Class TransactionalEventSequence
- Namespace
- Cratis.Chronicle.EventSequences
- Assembly
- Cratis.Chronicle.dll
Represents an implementation of ITransactionalEventSequence.
public class TransactionalEventSequence : ITransactionalEventSequence
- Inheritance
-
TransactionalEventSequence
- Implements
- Inherited Members
- Extension Methods
Constructors
TransactionalEventSequence(IEventSequence, IUnitOfWorkManager)
Represents an implementation of ITransactionalEventSequence.
public TransactionalEventSequence(IEventSequence eventSequence, IUnitOfWorkManager unitOfWorkManager)
Parameters
eventSequenceIEventSequenceThe target IEventSequence.
unitOfWorkManagerIUnitOfWorkManagerIUnitOfWorkManager for working with the unit of work.
Fields
CausationType
The causation type for the transactional event sequence.
public static readonly CausationType CausationType
Field Value
TransactionalEventSequenceIdProperty
The event sequence id causation property.
public const string TransactionalEventSequenceIdProperty = "eventSequenceId"
Field Value
Properties
UnitOfWork
Gets the current IUnitOfWork.
public IUnitOfWork UnitOfWork { get; }
Property Value
Methods
Append(EventSourceId, object, EventStreamType?, EventStreamId?, EventSourceType?, ConcurrencyScope?, IEnumerable<string>?, DateTimeOffset?, Subject?)
Append a single event to the event store.
public Task Append(EventSourceId eventSourceId, object @event, EventStreamType? eventStreamType = null, EventStreamId? eventStreamId = null, EventSourceType? eventSourceType = null, ConcurrencyScope? concurrencyScope = null, IEnumerable<string>? tags = null, DateTimeOffset? occurred = null, Subject? subject = null)
Parameters
eventSourceIdEventSourceIdThe EventSourceId to append for.
eventobjectThe event.
eventStreamTypeEventStreamTypeOptional EventStreamType to append to. Defaults to All.
eventStreamIdEventStreamIdOptional EventStreamId to append to. Defaults to Default.
eventSourceTypeEventSourceTypeOptional EventSourceType to append to. Defaults to Default.
concurrencyScopeConcurrencyScopeOptional ConcurrencyScope to use for concurrency control. Defaults to None.
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
AppendMany(EventSourceId, IEnumerable<object>, EventStreamType?, EventStreamId?, EventSourceType?, ConcurrencyScope?, IEnumerable<string>?, DateTimeOffset?, Subject?)
Append a collection of events to the event store.
public Task AppendMany(EventSourceId eventSourceId, IEnumerable<object> events, EventStreamType? eventStreamType = null, EventStreamId? eventStreamId = null, EventSourceType? eventSourceType = null, ConcurrencyScope? concurrencyScope = null, IEnumerable<string>? tags = null, DateTimeOffset? occurred = null, Subject? subject = null)
Parameters
eventSourceIdEventSourceIdThe EventSourceId to append for.
eventsIEnumerable<object>Collection of events to append.
eventStreamTypeEventStreamTypeOptional EventStreamType to append to. Defaults to All.
eventStreamIdEventStreamIdOptional EventStreamId to append to. Defaults to Default.
eventSourceTypeEventSourceTypeOptional EventSourceType to append to. Defaults to Default.
concurrencyScopeConcurrencyScopeOptional ConcurrencyScope to use for concurrency control. Defaults to None.
tagsIEnumerable<string>Optional dynamic tags to associate with the events.
occurredDateTimeOffset?Optional timestamp for when the events occurred.
subjectSubjectOptional subject identifying what the events are about.
Returns
AppendManyWithNamedTags(EventSourceId, IEnumerable<object>, IEnumerable<NamedTag>, EventStreamType?, EventStreamId?, EventSourceType?, ConcurrencyScope?, IEnumerable<string>?, DateTimeOffset?, Subject?)
Append events with structured named tags to the current unit of work.
public Task AppendManyWithNamedTags(EventSourceId eventSourceId, IEnumerable<object> events, IEnumerable<NamedTag> namedTags, EventStreamType? eventStreamType = null, EventStreamId? eventStreamId = null, EventSourceType? eventSourceType = null, ConcurrencyScope? concurrencyScope = null, IEnumerable<string>? tags = null, DateTimeOffset? occurred = null, Subject? subject = null)
Parameters
eventSourceIdEventSourceIdThe event source.
eventsIEnumerable<object>The events.
namedTagsIEnumerable<NamedTag>Structured named tags for every event.
eventStreamTypeEventStreamTypeOptional stream type.
eventStreamIdEventStreamIdOptional stream id.
eventSourceTypeEventSourceTypeOptional source type.
concurrencyScopeConcurrencyScopeOptional concurrency scope.
tagsIEnumerable<string>Optional plain tags.
occurredDateTimeOffset?Optional occurred time.
subjectSubjectOptional subject.
Returns
- Task
Awaitable task.
Exceptions
- NamedTagsNotSupported
The implementation cannot carry nonempty named tags.
AppendWithNamedTags(EventSourceId, object, IEnumerable<NamedTag>, EventStreamType?, EventStreamId?, EventSourceType?, ConcurrencyScope?, IEnumerable<string>?, DateTimeOffset?, Subject?)
Append an event with structured named tags to the current unit of work.
public Task AppendWithNamedTags(EventSourceId eventSourceId, object @event, IEnumerable<NamedTag> namedTags, EventStreamType? eventStreamType = null, EventStreamId? eventStreamId = null, EventSourceType? eventSourceType = null, ConcurrencyScope? concurrencyScope = null, IEnumerable<string>? tags = null, DateTimeOffset? occurred = null, Subject? subject = null)
Parameters
eventSourceIdEventSourceIdThe event source.
eventobjectThe event.
namedTagsIEnumerable<NamedTag>Structured named tags.
eventStreamTypeEventStreamTypeOptional stream type.
eventStreamIdEventStreamIdOptional stream id.
eventSourceTypeEventSourceTypeOptional source type.
concurrencyScopeConcurrencyScopeOptional concurrency scope.
tagsIEnumerable<string>Optional plain tags.
occurredDateTimeOffset?Optional occurred time.
subjectSubjectOptional subject.
Returns
- Task
Awaitable task.
Exceptions
- NamedTagsNotSupported
The implementation cannot carry nonempty named tags.