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
TEventEvent to build for.
TBuilderType of actual builder.
Methods
UsingConstantParentKey(string)
Define a constant value to use as the parent key. All events of this type will update the same parent read model instance.
TBuilder UsingConstantParentKey(string value)
Parameters
valuestringThe constant value to use as parent key.
Returns
- TBuilder
Builder continuation.
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 read model to work with.
TBuilder UsingParentCompositeKey<TKeyType>(Action<ICompositeKeyBuilder<TKeyType, TEvent>> builderCallback)
Parameters
builderCallbackAction<ICompositeKeyBuilder<TKeyType, TEvent>>Builder callback for building the composite key.
Returns
- TBuilder
Builder continuation.
Type Parameters
TKeyTypeType 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 read model to work with.
TBuilder UsingParentKeyFromContext<TProperty>(Expression<Func<EventContext, TProperty>> keyAccessor)
Parameters
keyAccessorExpression<Func<EventContext, TProperty>>Accessor for the property to use.
Returns
- TBuilder
Builder continuation.
Type Parameters
TPropertyType 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 read model to work with.
TBuilder UsingParentKey<TProperty>(Expression<Func<TEvent, TProperty>> keyAccessor)
Parameters
keyAccessorExpression<Func<TEvent, TProperty>>Accessor for the property to use.
Returns
- TBuilder
Builder continuation.
Type Parameters
TPropertyType of the property.