Class EventForEventSourceId

Namespace
Cratis.Chronicle.EventSequences
Assembly
Cratis.Chronicle.dll

Represents an event and the EventSourceId it is for.

public record EventForEventSourceId : IEquatable<EventForEventSourceId>
Inheritance
EventForEventSourceId
Implements
Inherited Members
Extension Methods

Constructors

EventForEventSourceId(EventForEventSourceId)

protected EventForEventSourceId(EventForEventSourceId original)

Parameters

original EventForEventSourceId

EventForEventSourceId(EventSourceId, object, Causation?)

Represents an event and the EventSourceId it is for.

public EventForEventSourceId(EventSourceId EventSourceId, object Event, Causation? Causation = null)

Parameters

EventSourceId EventSourceId

EventSourceId the event is for.

Event object

The actual event.

Causation Causation

Optional causation for the event. If not set, the current causation chain is used.

Properties

Causation

Optional causation for the event. If not set, the current causation chain is used.

public Causation? Causation { get; init; }

Property Value

Causation

DeclaredConcurrency

Gets or inits concurrency dimensions to resolve individually at an Enforce commit.

public ConcurrencyDimensions? DeclaredConcurrency { get; init; }

Property Value

ConcurrencyDimensions?

EqualityContract

protected virtual Type EqualityContract { get; }

Property Value

Type

Event

The actual event.

public object Event { get; init; }

Property Value

object

EventSource

Gets or inits the type of the IEventSource the event is appended through. When set, the EventSourceType and EventStreamType are taken from the definition, and explicit values that contradict it are rejected.

public Type? EventSource { get; init; }

Property Value

Type

EventSourceId

EventSourceId the event is for.

public EventSourceId EventSourceId { get; init; }

Property Value

EventSourceId

EventSourceType

Gets or inits the EventSourceType for the event. Defaults to Default.

public EventSourceType EventSourceType { get; init; }

Property Value

EventSourceType

EventStream

Gets or inits the name of the stream declared by EventSource the event is appended to.

public string? EventStream { get; init; }

Property Value

string

EventStreamId

Gets or inits the EventStreamId for the event. Defaults to Default.

public EventStreamId EventStreamId { get; init; }

Property Value

EventStreamId

EventStreamType

Gets or inits the EventStreamType for the event. Defaults to All.

public EventStreamType EventStreamType { get; init; }

Property Value

EventStreamType

IdempotencyKey

Gets or inits the optional IdempotencyKey that makes appending this event idempotent. A batch in which any event has a key is appended once; events without a key are appended normally.

public IdempotencyKey? IdempotencyKey { get; init; }

Property Value

IdempotencyKey

NamedTags

Gets or inits the structured named tags for this event.

public IEnumerable<NamedTag> NamedTags { get; init; }

Property Value

IEnumerable<NamedTag>

Exceptions

InvalidNamedTag

The collection contains a null named tag.

Occurred

Gets or inits the optional occurred time. If not set, the server will set it to approximately the time of append.

public DateTimeOffset? Occurred { get; init; }

Property Value

DateTimeOffset?

Subject

Gets or inits the optional Subject for the event. When omitted, Chronicle derives it from a SubjectAttribute on the event, or falls back to EventSourceId.

public Subject? Subject { get; init; }

Property Value

Subject

Tags

Gets or inits the tags to associate with the event. These are combined with any static tags declared on the event type and any tags supplied at append time.

public IEnumerable<string> Tags { get; init; }

Property Value

IEnumerable<string>

Methods

Deconstruct(out EventSourceId, out object, out Causation?)

public void Deconstruct(out EventSourceId EventSourceId, out object Event, out Causation? Causation)

Parameters

EventSourceId EventSourceId
Event object
Causation Causation

Equals(EventForEventSourceId?)

public virtual bool Equals(EventForEventSourceId? other)

Parameters

other EventForEventSourceId

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

PrintMembers(StringBuilder)

protected virtual bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

ToString()

public override string ToString()

Returns

string

Operators

operator ==(EventForEventSourceId?, EventForEventSourceId?)

public static bool operator ==(EventForEventSourceId? left, EventForEventSourceId? right)

Parameters

left EventForEventSourceId
right EventForEventSourceId

Returns

bool

operator !=(EventForEventSourceId?, EventForEventSourceId?)

public static bool operator !=(EventForEventSourceId? left, EventForEventSourceId? right)

Parameters

left EventForEventSourceId
right EventForEventSourceId

Returns

bool