Class EventSourceDefinition

Namespace
Cratis.Chronicle.EventSources
Assembly
Cratis.Chronicle.dll

Represents a discovered IEventSource definition.

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

Constructors

EventSourceDefinition(EventSourceDefinition)

protected EventSourceDefinition(EventSourceDefinition original)

Parameters

original EventSourceDefinition

EventSourceDefinition(Type, string, string, ConcurrencyDimensions, IReadOnlyList<EventStream>)

Represents a discovered IEventSource definition.

public EventSourceDefinition(Type ClrType, string Name, string Description, ConcurrencyDimensions Concurrency, IReadOnlyList<EventStream> Streams)

Parameters

ClrType Type

The type carrying the definition.

Name string

The name of the event source, which is the event source type of appended events.

Description string

The description of the event source.

Concurrency ConcurrencyDimensions

The default dimensions that take part in concurrency checks.

Streams IReadOnlyList<EventStream>

The streams of the event source.

Properties

ClrType

The type carrying the definition.

public Type ClrType { get; init; }

Property Value

Type

Concurrency

The default dimensions that take part in concurrency checks.

public ConcurrencyDimensions Concurrency { get; init; }

Property Value

ConcurrencyDimensions

Description

The description of the event source.

public string Description { get; init; }

Property Value

string

EqualityContract

protected virtual Type EqualityContract { get; }

Property Value

Type

EventSourceType

Gets the name as an EventSourceType.

public EventSourceType EventSourceType { get; }

Property Value

EventSourceType

Name

The name of the event source, which is the event source type of appended events.

public string Name { get; init; }

Property Value

string

Streams

The streams of the event source.

public IReadOnlyList<EventStream> Streams { get; init; }

Property Value

IReadOnlyList<EventStream>

Methods

ConcurrencyFor(EventStream?)

Gets the dimensions that apply to an append, from the stream when one is given and declares any, otherwise from the event source.

public ConcurrencyDimensions ConcurrencyFor(EventStream? stream)

Parameters

stream EventStream

The stream the append is to, if any.

Returns

ConcurrencyDimensions

The effective ConcurrencyDimensions.

Deconstruct(out Type, out string, out string, out ConcurrencyDimensions, out IReadOnlyList<EventStream>)

public void Deconstruct(out Type ClrType, out string Name, out string Description, out ConcurrencyDimensions Concurrency, out IReadOnlyList<EventStream> Streams)

Parameters

ClrType Type
Name string
Description string
Concurrency ConcurrencyDimensions
Streams IReadOnlyList<EventStream>

Equals(EventSourceDefinition?)

public virtual bool Equals(EventSourceDefinition? other)

Parameters

other EventSourceDefinition

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

FindStream(string)

Find a stream by name.

public EventStream? FindStream(string name)

Parameters

name string

The name of the stream.

Returns

EventStream

The EventStream if the definition has it; otherwise null.

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 ==(EventSourceDefinition?, EventSourceDefinition?)

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

Parameters

left EventSourceDefinition
right EventSourceDefinition

Returns

bool

operator !=(EventSourceDefinition?, EventSourceDefinition?)

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

Parameters

left EventSourceDefinition
right EventSourceDefinition

Returns

bool