Interface IKeyBuilder<TEvent>

Namespace
Cratis.Chronicle.Keys
Assembly
Cratis.Chronicle.dll

Defines a key builder for a specific event.

public interface IKeyBuilder<TEvent>

Type Parameters

TEvent

Type of event the builder is for.

Extension Methods

Methods

UsingCompositeKey<TKeyType>(Action<ICompositeKeyBuilder<TKeyType, TEvent>>)

Define what key to use based on a composite of expressions.

void UsingCompositeKey<TKeyType>(Action<ICompositeKeyBuilder<TKeyType, TEvent>> builderCallback)

Parameters

builderCallback Action<ICompositeKeyBuilder<TKeyType, TEvent>>

Builder callback for building the composite key.

Type Parameters

TKeyType

Type of key.

UsingKeyFromContext<TProperty>(Expression<Func<TEvent, EventContext>>)

Define what key to use based on a value in the EventContext.

void UsingKeyFromContext<TProperty>(Expression<Func<TEvent, EventContext>> keyAccessor)

Parameters

keyAccessor Expression<Func<TEvent, EventContext>>

Accessor for the property within EventContext to use.

Type Parameters

TProperty

Type of the property.

UsingKey<TProperty>(Expression<Func<TEvent, TProperty>>)

Define what key to use. This is optional, if not set - it will default to using the event source identifier on the event.

void UsingKey<TProperty>(Expression<Func<TEvent, TProperty>> keyAccessor)

Parameters

keyAccessor Expression<Func<TEvent, TProperty>>

Accessor for the property to use.

Type Parameters

TProperty

Type of the property.