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

eventSequence IEventSequence

The target IEventSequence.

unitOfWorkManager IUnitOfWorkManager

IUnitOfWorkManager for working with the unit of work.

Fields

CausationType

The causation type for the transactional event sequence.

public static readonly CausationType CausationType

Field Value

CausationType

TransactionalEventSequenceIdProperty

The event sequence id causation property.

public const string TransactionalEventSequenceIdProperty = "eventSequenceId"

Field Value

string

Properties

UnitOfWork

Gets the current IUnitOfWork.

public IUnitOfWork UnitOfWork { get; }

Property Value

IUnitOfWork

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

eventSourceId EventSourceId

The EventSourceId to append for.

event object

The event.

eventStreamType EventStreamType

Optional EventStreamType to append to. Defaults to All.

eventStreamId EventStreamId

Optional EventStreamId to append to. Defaults to Default.

eventSourceType EventSourceType

Optional EventSourceType to append to. Defaults to Default.

concurrencyScope ConcurrencyScope

Optional ConcurrencyScope to use for concurrency control. Defaults to None.

tags IEnumerable<string>

Optional dynamic tags to associate with the event.

occurred DateTimeOffset?

Optional timestamp for when the event occurred.

subject Subject

Optional subject identifying what the event is about.

Returns

Task

Awaitable Task.

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

eventSourceId EventSourceId

The EventSourceId to append for.

events IEnumerable<object>

Collection of events to append.

eventStreamType EventStreamType

Optional EventStreamType to append to. Defaults to All.

eventStreamId EventStreamId

Optional EventStreamId to append to. Defaults to Default.

eventSourceType EventSourceType

Optional EventSourceType to append to. Defaults to Default.

concurrencyScope ConcurrencyScope

Optional ConcurrencyScope to use for concurrency control. Defaults to None.

tags IEnumerable<string>

Optional dynamic tags to associate with the events.

occurred DateTimeOffset?

Optional timestamp for when the events occurred.

subject Subject

Optional subject identifying what the events are about.

Returns

Task

Awaitable Task.

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

eventSourceId EventSourceId

The event source.

events IEnumerable<object>

The events.

namedTags IEnumerable<NamedTag>

Structured named tags for every event.

eventStreamType EventStreamType

Optional stream type.

eventStreamId EventStreamId

Optional stream id.

eventSourceType EventSourceType

Optional source type.

concurrencyScope ConcurrencyScope

Optional concurrency scope.

tags IEnumerable<string>

Optional plain tags.

occurred DateTimeOffset?

Optional occurred time.

subject Subject

Optional 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

eventSourceId EventSourceId

The event source.

event object

The event.

namedTags IEnumerable<NamedTag>

Structured named tags.

eventStreamType EventStreamType

Optional stream type.

eventStreamId EventStreamId

Optional stream id.

eventSourceType EventSourceType

Optional source type.

concurrencyScope ConcurrencyScope

Optional concurrency scope.

tags IEnumerable<string>

Optional plain tags.

occurred DateTimeOffset?

Optional occurred time.

subject Subject

Optional subject.

Returns

Task

Awaitable task.

Exceptions

NamedTagsNotSupported

The implementation cannot carry nonempty named tags.