Table of Contents

Class ChildrenBuilder<TParentReadModel, TChildReadModel>

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

Represents an implementation of IChildrenBuilder<TParentReadModel, TChildReadModel>.

public class ChildrenBuilder<TParentReadModel, TChildReadModel> : ProjectionBuilder<TChildReadModel, IChildrenBuilder<TParentReadModel, TChildReadModel>>, IChildrenBuilder<TParentReadModel, TChildReadModel>, IProjectionBuilder<TChildReadModel, IChildrenBuilder<TParentReadModel, TChildReadModel>>, IChildrenBuilder

Type Parameters

TParentReadModel

Parent read model type.

TChildReadModel

Child read model type.

Inheritance
ProjectionBuilder<TChildReadModel, IChildrenBuilder<TParentReadModel, TChildReadModel>>
ChildrenBuilder<TParentReadModel, TChildReadModel>
Implements
IChildrenBuilder<TParentReadModel, TChildReadModel>
IProjectionBuilder<TChildReadModel, IChildrenBuilder<TParentReadModel, TChildReadModel>>
Inherited Members

Constructors

ChildrenBuilder(INamingPolicy, IEventTypes, JsonSerializerOptions, AutoMap)

Represents an implementation of IChildrenBuilder<TParentReadModel, TChildReadModel>.

public ChildrenBuilder(INamingPolicy namingPolicy, IEventTypes eventTypes, JsonSerializerOptions jsonSerializerOptions, AutoMap autoMap)

Parameters

namingPolicy INamingPolicy

The INamingPolicy to use for converting names during serialization.

eventTypes IEventTypes

IEventTypes for providing event type information.

jsonSerializerOptions JsonSerializerOptions

The JsonSerializerOptions to use for any JSON serialization.

autoMap AutoMap

AutoMap behavior for properties - inherits from parent by default.

Properties

HasIdentifiedBy

Gets whether or not the builder has identified by.

public bool HasIdentifiedBy { get; }

Property Value

bool

Methods

FromEventProperty<TEvent>(Expression<Func<TEvent, TChildReadModel>>)

Defines the event and property on it that the child should be created as a value from.

public IChildrenBuilder<TParentReadModel, TChildReadModel> FromEventProperty<TEvent>(Expression<Func<TEvent, TChildReadModel>> propertyExpression)

Parameters

propertyExpression Expression<Func<TEvent, TChildReadModel>>

The expression that represents the property on the event to use.

Returns

IChildrenBuilder<TParentReadModel, TChildReadModel>

Builder continuation.

Type Parameters

TEvent

Type of event.

GetIdentifiedBy()

Gets the property path that identifies the child read model in the collection within the parent.

public PropertyPath GetIdentifiedBy()

Returns

PropertyPath

Cratis.Chronicle.Properties.PropertyPath for the identified by.

IdentifiedBy(PropertyPath)

Sets the property that identifies the child read model in the collection within the parent.

public IChildrenBuilder<TParentReadModel, TChildReadModel> IdentifiedBy(PropertyPath propertyPath)

Parameters

propertyPath PropertyPath

The Cratis.Chronicle.Properties.PropertyPath that represents the property used to identify.

Returns

IChildrenBuilder<TParentReadModel, TChildReadModel>

Builder continuation.

IdentifiedBy<TProperty>(Expression<Func<TChildReadModel, TProperty>>)

Sets the property that identifies the child read model in the collection within the parent.

public IChildrenBuilder<TParentReadModel, TChildReadModel> IdentifiedBy<TProperty>(Expression<Func<TChildReadModel, TProperty>> propertyExpression)

Parameters

propertyExpression Expression<Func<TChildReadModel, TProperty>>

The expression that represents the property used to identify.

Returns

IChildrenBuilder<TParentReadModel, TChildReadModel>

Builder continuation.

Type Parameters

TProperty

Type of property.