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

TReadModel

Type 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

namingPolicy INamingPolicy

The 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

readModelPropertyAccessor Expression<Func<TReadModel, IDictionary<string, TValue>>>

Read model property accessor for the dictionary-typed target property.

dynamicKeyAccessor Expression<Func<EventContext, object>>

Accessor for the EventContext property to derive the dictionary key from.

Returns

IFromAllBuilder<TReadModel>

Builder continuation.

Type Parameters

TValue

Type 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

readModelPropertyAccessor Expression<Func<TReadModel, TProperty>>

Read model property accessor for defining the target property.

Returns

IFromAllBuilder<TReadModel>

Builder continuation.

Type Parameters

TProperty

Type 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

readModelPropertyAccessor Expression<Func<TReadModel, IDictionary<string, TValue>>>

Read model property accessor for the dictionary-typed target property.

dynamicKeyAccessor Expression<Func<EventContext, object>>

Accessor for the EventContext property to derive the dictionary key from.

Returns

IFromAllBuilder<TReadModel>

Builder continuation.

Type Parameters

TValue

Type 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

readModelPropertyAccessor Expression<Func<TReadModel, TProperty>>

Read model property accessor for defining the target property.

Returns

IFromAllBuilder<TReadModel>

Builder continuation.

Type Parameters

TProperty

Type 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

readModelPropertyAccessor Expression<Func<TReadModel, IDictionary<string, TValue>>>

Read model property accessor for the dictionary-typed target property.

dynamicKeyAccessor Expression<Func<EventContext, object>>

Accessor for the EventContext property to derive the dictionary key from.

Returns

IFromAllBuilder<TReadModel>

Builder continuation.

Type Parameters

TValue

Type 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

readModelPropertyAccessor Expression<Func<TReadModel, TProperty>>

Read model property accessor for defining the target property.

Returns

IFromAllBuilder<TReadModel>

Builder continuation.

Type Parameters

TProperty

Type 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

readModelPropertyAccessor Expression<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

TProperty

Type of the property.