Table of Contents

Interface IKeyBuilder<TEvent, TBuilder>

Namespace
Cratis.Chronicle.Projections
Assembly
Cratis.Chronicle.dll

Defines a builder for keys.

public interface IKeyBuilder<TEvent, TBuilder>

Type Parameters

TEvent

Event to build for.

TBuilder

Type of actual builder.

Methods

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

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

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

Parameters

builderCallback Action<ICompositeKeyBuilder<TKeyType, TEvent>>

Builder callback for building the composite key.

Returns

TBuilder

Builder continuation.

Type Parameters

TKeyType

Type of key.

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

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

TBuilder UsingKeyFromContext<TProperty>(Expression<Func<EventContext, TProperty>> keyAccessor)

Parameters

keyAccessor Expression<Func<EventContext, TProperty>>

Accessor for the property within EventContext to use.

Returns

TBuilder

Builder continuation.

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.

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

Parameters

keyAccessor Expression<Func<TEvent, TProperty>>

Accessor for the property to use.

Returns

TBuilder

Builder continuation.

Type Parameters

TProperty

Type of the property.