Table of Contents

Class ParentKeyBuilder<TEvent, TBuilder>

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

Represents a default implementation of IKeyBuilder<TEvent, TBuilder> that works with IEventValueExpression.

public class ParentKeyBuilder<TEvent, TBuilder> : IParentKeyBuilder<TEvent, TBuilder> where TBuilder : class

Type Parameters

TEvent

Event to build for.

TBuilder

Type of actual builder.

Inheritance
ParentKeyBuilder<TEvent, TBuilder>
Implements
IParentKeyBuilder<TEvent, TBuilder>
Inherited Members

Fields

_parentKeyExpression

protected PropertyExpression _parentKeyExpression

Field Value

PropertyExpression

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.

public 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.

public 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.

public 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.