Class AllSetBuilder<TReadModel, TParentBuilder>
- Namespace
- Cratis.Chronicle.Projections
- Assembly
- Cratis.Chronicle.dll
Represents an implementation of IAllSetBuilder<TReadModel, TParentBuilder>.
public class AllSetBuilder<TReadModel, TParentBuilder> : IAllSetBuilder<TReadModel, TParentBuilder>, IPropertyExpressionBuilder
Type Parameters
TReadModelRead model to build for.
TParentBuilderType of the parent builder.
- Inheritance
-
AllSetBuilder<TReadModel, TParentBuilder>
- Implements
-
IAllSetBuilder<TReadModel, TParentBuilder>
- Inherited Members
- Extension Methods
Constructors
AllSetBuilder(TParentBuilder, PropertyPath, INamingPolicy)
Represents an implementation of IAllSetBuilder<TReadModel, TParentBuilder>.
public AllSetBuilder(TParentBuilder parent, PropertyPath targetProperty, INamingPolicy namingPolicy)
Parameters
parentTParentBuilderParent builder.
targetPropertyPropertyPathTarget property we're building for.
namingPolicyINamingPolicyThe INamingPolicy to use for property names.
Properties
TargetProperty
Gets the target property.
public PropertyPath TargetProperty { get; }
Property Value
Methods
Build()
Builds the expression.
public string Build()
Returns
- string
The expression built.
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.
ToEventSourceId()
Map to the event source id on the metadata of the event.
public TParentBuilder ToEventSourceId()
Returns
- TParentBuilder
Builder continuation.
ToValue<TProperty>(TProperty)
Map to a constant value for every matching event.
public TParentBuilder ToValue<TProperty>(TProperty value)
Parameters
valueTPropertyThe value to set, or null to clear the property.
Returns
- TParentBuilder
Builder continuation.
Type Parameters
TPropertyType of the constant value.
Remarks
The value is not type-checked against the target read model property, because this builder does not carry the
property type - TProperty is inferred from value. Pass a value whose type
matches the property; a mismatch is not reported when the projection is defined.