Table of Contents

Class ModelPropertiesBuilder<TModel, TEvent, TBuilder, TParentBuilder>

Namespace
Cratis.Chronicle.Projections
Assembly
Cratis.Chronicle.dll

Represents an implementation of IModelPropertiesBuilder<TModel, TEvent, TBuilder>.

public class ModelPropertiesBuilder<TModel, TEvent, TBuilder, TParentBuilder> : KeyAndParentKeyBuilder<TEvent, TBuilder>, IKeyBuilder<TEvent, TBuilder>, IParentKeyBuilder<TEvent, TBuilder>, IModelPropertiesBuilder<TModel, TEvent, TBuilder> where TBuilder : class, IModelPropertiesBuilder<TModel, TEvent, TBuilder> where TParentBuilder : class

Type Parameters

TModel

Model to build for.

TEvent

Event to build for.

TBuilder

Type of actual builder.

TParentBuilder

The type of parent builder.

Inheritance
KeyBuilder<TEvent, TBuilder>
KeyAndParentKeyBuilder<TEvent, TBuilder>
ModelPropertiesBuilder<TModel, TEvent, TBuilder, TParentBuilder>
Implements
IKeyBuilder<TEvent, TBuilder>
IParentKeyBuilder<TEvent, TBuilder>
IModelPropertiesBuilder<TModel, TEvent, TBuilder>
Derived
Inherited Members

Constructors

ModelPropertiesBuilder(IProjectionBuilder<TModel, TParentBuilder>)

Represents an implementation of IModelPropertiesBuilder<TModel, TEvent, TBuilder>.

public ModelPropertiesBuilder(IProjectionBuilder<TModel, TParentBuilder> projectionBuilder)

Parameters

projectionBuilder IProjectionBuilder<TModel, TParentBuilder>

The parent IProjectionBuilderFor<TModel>.

Fields

_propertyExpressions

protected readonly Dictionary<PropertyPath, IPropertyExpressionBuilder> _propertyExpressions

Field Value

Dictionary<PropertyPath, IPropertyExpressionBuilder>

Methods

AddChild<TChildModel>(Expression<Func<TModel, IEnumerable<TChildModel>>>, Action<IAddChildBuilder<TChildModel, TEvent>>)

Start building the add child operation to a target property holding an collection of a specific child model type.

public TBuilder AddChild<TChildModel>(Expression<Func<TModel, IEnumerable<TChildModel>>> targetProperty, Action<IAddChildBuilder<TChildModel, TEvent>> builderCallback)

Parameters

targetProperty Expression<Func<TModel, IEnumerable<TChildModel>>>

The collection property that will receive the child.

builderCallback Action<IAddChildBuilder<TChildModel, TEvent>>

Builder callback for building the composite key.

Returns

TBuilder

Builder continuation.

Type Parameters

TChildModel

Type of child model.

AddChild<TChildModel>(Expression<Func<TModel, IEnumerable<TChildModel>>>, Expression<Func<TEvent, TChildModel>>)

Start building a child operation that add a child based on a property on the event.

public TBuilder AddChild<TChildModel>(Expression<Func<TModel, IEnumerable<TChildModel>>> targetProperty, Expression<Func<TEvent, TChildModel>> eventProperty)

Parameters

targetProperty Expression<Func<TModel, IEnumerable<TChildModel>>>

The collection property that will receive the child.

eventProperty Expression<Func<TEvent, TChildModel>>

Event property accessor for defining the source property.

Returns

TBuilder

Builder continuation.

Type Parameters

TChildModel

Type of child model.

Add<TProperty>(Expression<Func<TModel, TProperty>>)

Start building the add operation to a target property on the model.

public IAddBuilder<TModel, TEvent, TProperty, TBuilder> Add<TProperty>(Expression<Func<TModel, TProperty>> modelPropertyAccessor)

Parameters

modelPropertyAccessor Expression<Func<TModel, TProperty>>

Model property accessor for defining the target property.

Returns

IAddBuilder<TModel, TEvent, TProperty, TBuilder>

Builder continuation.

Type Parameters

TProperty

Type of the property.

AutoMap()

Automatically map event properties to model properties on the events added.

public TBuilder AutoMap()

Returns

TBuilder

Builder continuation.

Count<TProperty>(Expression<Func<TModel, TProperty>>)

Start building the count operation to a target property on the model.

public TBuilder Count<TProperty>(Expression<Func<TModel, TProperty>> modelPropertyAccessor)

Parameters

modelPropertyAccessor Expression<Func<TModel, TProperty>>

Model property accessor for defining the target property.

Returns

TBuilder

Builder continuation.

Type Parameters

TProperty

Type of the property.

Decrement<TProperty>(Expression<Func<TModel, TProperty>>)

Increment the value of a property on the model.

public TBuilder Decrement<TProperty>(Expression<Func<TModel, TProperty>> modelPropertyAccessor)

Parameters

modelPropertyAccessor Expression<Func<TModel, TProperty>>

Model property accessor for defining the target property.

Returns

TBuilder

Builder continuation.

Type Parameters

TProperty

Type of the property.

Increment<TProperty>(Expression<Func<TModel, TProperty>>)

Increment the value of a property on the model.

public TBuilder Increment<TProperty>(Expression<Func<TModel, TProperty>> modelPropertyAccessor)

Parameters

modelPropertyAccessor Expression<Func<TModel, TProperty>>

Model property accessor for defining the target property.

Returns

TBuilder

Builder continuation.

Type Parameters

TProperty

Type of the property.

Set(PropertyPath)

Start building the set operation to a target property on the model.

public ISetBuilder<TModel, TEvent, TBuilder> Set(PropertyPath propertyPath)

Parameters

propertyPath PropertyPath

Model property path for defining the target property.

Returns

ISetBuilder<TModel, TEvent, TBuilder>

The ISetBuilder<TModel, TEvent, TParentBuilder> to continue building on.

SetThisValue()

Start building the set operation to target the value instance itself.

public ISetBuilder<TModel, TEvent, TBuilder> SetThisValue()

Returns

ISetBuilder<TModel, TEvent, TBuilder>

The ISetBuilder<TModel, TEvent, TParentBuilder> to continue building on.

Set<TProperty>(Expression<Func<TModel, TProperty>>)

Start building the set operation to a target property on the model.

public ISetBuilder<TModel, TEvent, TProperty, TBuilder> Set<TProperty>(Expression<Func<TModel, TProperty>> modelPropertyAccessor)

Parameters

modelPropertyAccessor Expression<Func<TModel, TProperty>>

Model property accessor for defining the target property.

Returns

ISetBuilder<TModel, TEvent, TProperty, TBuilder>

The ISetBuilder<TModel, TEvent, TProperty, TParentBuilder> to continue building on.

Type Parameters

TProperty

Type of the property.

Subtract<TProperty>(Expression<Func<TModel, TProperty>>)

Start building the add operation to a target property on the model.

public ISubtractBuilder<TModel, TEvent, TProperty, TBuilder> Subtract<TProperty>(Expression<Func<TModel, TProperty>> modelPropertyAccessor)

Parameters

modelPropertyAccessor Expression<Func<TModel, TProperty>>

Model property accessor for defining the target property.

Returns

ISubtractBuilder<TModel, TEvent, TProperty, TBuilder>

Builder continuation.

Type Parameters

TProperty

Type of the property.