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
TParentReadModelParent read model type.
TChildReadModelChild 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
namingPolicyINamingPolicyThe INamingPolicy to use for converting names during serialization.
eventTypesIEventTypesIEventTypes for providing event type information.
jsonSerializerOptionsJsonSerializerOptionsThe JsonSerializerOptions to use for any JSON serialization.
autoMapAutoMapAutoMap 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
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
propertyExpressionExpression<Func<TEvent, TChildReadModel>>The expression that represents the property on the event to use.
Returns
- IChildrenBuilder<TParentReadModel, TChildReadModel>
Builder continuation.
Type Parameters
TEventType 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
propertyPathPropertyPathThe 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
propertyExpressionExpression<Func<TChildReadModel, TProperty>>The expression that represents the property used to identify.
Returns
- IChildrenBuilder<TParentReadModel, TChildReadModel>
Builder continuation.
Type Parameters
TPropertyType of property.