Class FromAllBuilder<TReadModel>
- Namespace
- Cratis.Chronicle.Projections
- Assembly
- Cratis.Chronicle.dll
Represents an implementation of IFromAllBuilder<TReadModel>. Its all-events subscription includes child events in their containing parent's mappings and also observes unrelated event types.
public class FromAllBuilder<TReadModel> : IFromAllBuilder<TReadModel>
Type Parameters
TReadModelType of read model to build for.
- Inheritance
-
FromAllBuilder<TReadModel>
- Implements
-
IFromAllBuilder<TReadModel>
- Inherited Members
- Extension Methods
Constructors
FromAllBuilder(INamingPolicy)
Represents an implementation of IFromAllBuilder<TReadModel>. Its all-events subscription includes child events in their containing parent's mappings and also observes unrelated event types.
public FromAllBuilder(INamingPolicy namingPolicy)
Parameters
namingPolicyINamingPolicyThe INamingPolicy to use for converting names during serialization.
Methods
Count<TValue>(Expression<Func<TReadModel, IDictionary<string, TValue>>>, Expression<Func<EventContext, object>>)
Count every event towards a key in a dictionary-typed property on the read model, where the key is resolved dynamically, per event, from the EventContext.
public IFromAllBuilder<TReadModel> Count<TValue>(Expression<Func<TReadModel, IDictionary<string, TValue>>> readModelPropertyAccessor, Expression<Func<EventContext, object>> dynamicKeyAccessor)
Parameters
readModelPropertyAccessorExpression<Func<TReadModel, IDictionary<string, TValue>>>Read model property accessor for the dictionary-typed target property.
dynamicKeyAccessorExpression<Func<EventContext, object>>Accessor for the EventContext property to derive the dictionary key from.
Returns
- IFromAllBuilder<TReadModel>
Builder continuation.
Type Parameters
TValueType of the dictionary value.
Count<TProperty>(Expression<Func<TReadModel, TProperty>>)
Count every event towards a property on the read model.
public IFromAllBuilder<TReadModel> Count<TProperty>(Expression<Func<TReadModel, TProperty>> readModelPropertyAccessor)
Parameters
readModelPropertyAccessorExpression<Func<TReadModel, TProperty>>Read model property accessor for defining the target property.
Returns
- IFromAllBuilder<TReadModel>
Builder continuation.
Type Parameters
TPropertyType of the property.
Decrement<TValue>(Expression<Func<TReadModel, IDictionary<string, TValue>>>, Expression<Func<EventContext, object>>)
Decrement a key in a dictionary-typed property on the read model, where the key is resolved dynamically, per event, from the EventContext.
public IFromAllBuilder<TReadModel> Decrement<TValue>(Expression<Func<TReadModel, IDictionary<string, TValue>>> readModelPropertyAccessor, Expression<Func<EventContext, object>> dynamicKeyAccessor)
Parameters
readModelPropertyAccessorExpression<Func<TReadModel, IDictionary<string, TValue>>>Read model property accessor for the dictionary-typed target property.
dynamicKeyAccessorExpression<Func<EventContext, object>>Accessor for the EventContext property to derive the dictionary key from.
Returns
- IFromAllBuilder<TReadModel>
Builder continuation.
Type Parameters
TValueType of the dictionary value.
Decrement<TProperty>(Expression<Func<TReadModel, TProperty>>)
Decrement a property on the read model for every event.
public IFromAllBuilder<TReadModel> Decrement<TProperty>(Expression<Func<TReadModel, TProperty>> readModelPropertyAccessor)
Parameters
readModelPropertyAccessorExpression<Func<TReadModel, TProperty>>Read model property accessor for defining the target property.
Returns
- IFromAllBuilder<TReadModel>
Builder continuation.
Type Parameters
TPropertyType of the property.
Increment<TValue>(Expression<Func<TReadModel, IDictionary<string, TValue>>>, Expression<Func<EventContext, object>>)
Increment a key in a dictionary-typed property on the read model, where the key is resolved dynamically, per event, from the EventContext.
public IFromAllBuilder<TReadModel> Increment<TValue>(Expression<Func<TReadModel, IDictionary<string, TValue>>> readModelPropertyAccessor, Expression<Func<EventContext, object>> dynamicKeyAccessor)
Parameters
readModelPropertyAccessorExpression<Func<TReadModel, IDictionary<string, TValue>>>Read model property accessor for the dictionary-typed target property.
dynamicKeyAccessorExpression<Func<EventContext, object>>Accessor for the EventContext property to derive the dictionary key from.
Returns
- IFromAllBuilder<TReadModel>
Builder continuation.
Type Parameters
TValueType of the dictionary value.
Increment<TProperty>(Expression<Func<TReadModel, TProperty>>)
Increment a property on the read model for every event.
public IFromAllBuilder<TReadModel> Increment<TProperty>(Expression<Func<TReadModel, TProperty>> readModelPropertyAccessor)
Parameters
readModelPropertyAccessorExpression<Func<TReadModel, TProperty>>Read model property accessor for defining the target property.
Returns
- IFromAllBuilder<TReadModel>
Builder continuation.
Type Parameters
TPropertyType of the property.
Set<TProperty>(Expression<Func<TReadModel, TProperty>>)
Start building the set operation to a target property on the read model.
public IAllSetBuilder<TReadModel, IFromAllBuilder<TReadModel>> Set<TProperty>(Expression<Func<TReadModel, TProperty>> readModelPropertyAccessor)
Parameters
readModelPropertyAccessorExpression<Func<TReadModel, TProperty>>Read model property accessor for defining the target property.
Returns
- IAllSetBuilder<TReadModel, IFromAllBuilder<TReadModel>>
The IAllSetBuilder<TReadModel, TParentBuilder> to build up the property expressions.
Type Parameters
TPropertyType of the property.