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
TEventType 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
builderCallbackAction<ICompositeKeyBuilder<TKeyType, TEvent>>Builder callback for building the composite key.
Type Parameters
TKeyTypeType 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
keyAccessorExpression<Func<TEvent, EventContext>>Accessor for the property within EventContext to use.
Type Parameters
TPropertyType 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
keyAccessorExpression<Func<TEvent, TProperty>>Accessor for the property to use.
Type Parameters
TPropertyType of the property.