Table of Contents

Class SetBuilder<TReadModel, TEvent, TProperty, TParentBuilder>

Namespace
Cratis.Chronicle.Projections
Assembly
Cratis.Chronicle.dll
public class SetBuilder<TReadModel, TEvent, TProperty, TParentBuilder> : SetBuilder<TReadModel, TEvent, TParentBuilder>, ISetBuilder<TReadModel, TEvent, TProperty, TParentBuilder>, ISetBuilder<TReadModel, TEvent, TParentBuilder>, IPropertyExpressionBuilder

Type Parameters

TReadModel

Read model to build for.

TEvent

Event to build for.

TProperty

The type of the property we're targeting.

TParentBuilder

Type of the parent builder.

Inheritance
SetBuilder<TReadModel, TEvent, TParentBuilder>
SetBuilder<TReadModel, TEvent, TProperty, TParentBuilder>
Implements
ISetBuilder<TReadModel, TEvent, TProperty, TParentBuilder>
ISetBuilder<TReadModel, TEvent, TParentBuilder>
Inherited Members

Remarks

Initializes a new instance of the SetBuilder<TReadModel, TEvent, TProperty, TParentBuilder> class.

Constructors

SetBuilder(TParentBuilder, PropertyPath, INamingPolicy, bool)

public SetBuilder(TParentBuilder parent, PropertyPath targetProperty, INamingPolicy namingPolicy, bool forceEventProperty = false)

Parameters

parent TParentBuilder

Parent builder.

targetProperty PropertyPath

Target property we're building for.

namingPolicy INamingPolicy

The INamingPolicy to use property names.

forceEventProperty bool

Whether or not to force this to have to map to a target property or not.

Remarks

Initializes a new instance of the SetBuilder<TReadModel, TEvent, TProperty, TParentBuilder> class.

Methods

To(Expression<Func<TEvent, TProperty>>)

Straight map to a property on the event.

public TParentBuilder To(Expression<Func<TEvent, TProperty>> eventPropertyAccessor)

Parameters

eventPropertyAccessor Expression<Func<TEvent, TProperty>>

Event property accessor for defining the source property.

Returns

TParentBuilder

Builder continuation.

ToEventContextProperty(Expression<Func<EventContext, object>>)

Map to a property on the EventContext.

public TParentBuilder ToEventContextProperty(Expression<Func<EventContext, object>> eventContextPropertyAccessor)

Parameters

eventContextPropertyAccessor Expression<Func<EventContext, object>>

Property accessor for specifying which property to map to.

Returns

TParentBuilder

Builder continuation.

ToValue(TProperty)

Set the property to a specific value.

public TParentBuilder ToValue(TProperty value)

Parameters

value TProperty

Value to set.

Returns

TParentBuilder

Builder continuation.