Class SetBuilder<TModel, TEvent, TProperty, TParentBuilder>
- Namespace
- Cratis.Chronicle.Projections
- Assembly
- Cratis.Chronicle.dll
Represents an implementation of ISetBuilder<TModel, TEvent, TProperty, TParentBuilder>.
public class SetBuilder<TModel, TEvent, TProperty, TParentBuilder> : SetBuilder<TModel, TEvent, TParentBuilder>, ISetBuilder<TModel, TEvent, TProperty, TParentBuilder>, ISetBuilder<TModel, TEvent, TParentBuilder>, IPropertyExpressionBuilder
Type Parameters
TModel
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<TModel, TEvent, TParentBuilder>SetBuilder<TModel, TEvent, TProperty, TParentBuilder>
- Implements
-
ISetBuilder<TModel, TEvent, TProperty, TParentBuilder>ISetBuilder<TModel, TEvent, TParentBuilder>
- Inherited Members
Remarks
Initializes a new instance of the SetBuilder<TModel, TEvent, TProperty, TParentBuilder> class.
Constructors
SetBuilder(TParentBuilder, PropertyPath, bool)
Represents an implementation of ISetBuilder<TModel, TEvent, TProperty, TParentBuilder>.
public SetBuilder(TParentBuilder parent, PropertyPath targetProperty, bool forceEventProperty = false)
Parameters
parent
TParentBuilderParent builder.
targetProperty
PropertyPathTarget property we're building for.
forceEventProperty
boolWhether or not to force this to have to map to a target property or not.
Remarks
Initializes a new instance of the SetBuilder<TModel, 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
TPropertyValue to set.
Returns
- TParentBuilder
Builder continuation.