Class SetBuilder<TReadModel, TEvent, TProperty, TParentBuilder>
- Namespace
- Cratis.Chronicle.Projections
- Assembly
- Cratis.Chronicle.dll
Represents an implementation of ISetBuilder<TReadModel, TEvent, TProperty, TParentBuilder>.
public class SetBuilder<TReadModel, TEvent, TProperty, TParentBuilder> : SetBuilder<TReadModel, TEvent, TParentBuilder>, ISetBuilder<TReadModel, TEvent, TProperty, TParentBuilder>, ISetBuilder<TReadModel, TEvent, TParentBuilder>, IPropertyExpressionBuilder
Type Parameters
TReadModelRead model to build for.
TEventEvent to build for.
TPropertyThe type of the property we're targeting.
TParentBuilderType 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)
Represents an implementation of ISetBuilder<TReadModel, TEvent, TProperty, TParentBuilder>.
public SetBuilder(TParentBuilder parent, PropertyPath targetProperty, INamingPolicy namingPolicy, bool forceEventProperty = false)
Parameters
parentTParentBuilderParent builder.
targetPropertyPropertyPathTarget property we're building for.
namingPolicyINamingPolicyThe INamingPolicy to use property names.
forceEventPropertyboolWhether 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
eventPropertyAccessorExpression<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
eventContextPropertyAccessorExpression<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
valueTPropertyValue to set.
Returns
- TParentBuilder
Builder continuation.