Interface IParentKeyBuilder<TEvent, TBuilder>
- Namespace
- Cratis.Chronicle.Projections
- Assembly
- Cratis.Chronicle.dll
Defines a builder for parent keys.
public interface IParentKeyBuilder<TEvent, TBuilder>
Type Parameters
TEvent
Event to build for.
TBuilder
Type of actual builder.
Methods
UsingParentCompositeKey<TKeyType>(Action<ICompositeKeyBuilder<TKeyType, TEvent>>)
Define what composite key based on properties on the event represents the parent key. This is typically used in child relationships to identify the parent model to work with.
TBuilder UsingParentCompositeKey<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.
UsingParentKeyFromContext<TProperty>(Expression<Func<EventContext, TProperty>>)
Define what property on the event represents the parent key based on a property in the EventContext. This is typically used in child relationships to identify the parent model to work with.
TBuilder UsingParentKeyFromContext<TProperty>(Expression<Func<EventContext, TProperty>> keyAccessor)
Parameters
keyAccessor
Expression<Func<EventContext, TProperty>>Accessor for the property to use.
Returns
- TBuilder
Builder continuation.
Type Parameters
TProperty
Type of the property.
UsingParentKey<TProperty>(Expression<Func<TEvent, TProperty>>)
Define what property on the event represents the parent key. This is typically used in child relationships to identify the parent model to work with.
TBuilder UsingParentKey<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.