Interface IChildrenBuilder<TParentReadModel, TChildReadModel>
- Namespace
- Cratis.Chronicle.Projections
- Assembly
- Cratis.Chronicle.dll
Defines the builder for building out a child relationship on a model.
public interface IChildrenBuilder<TParentReadModel, TChildReadModel> : IProjectionBuilder<TChildReadModel, IChildrenBuilder<TParentReadModel, TChildReadModel>>, IChildrenBuilder
Type Parameters
TParentReadModelParent read model type.
TChildReadModelChild read model type.
- Inherited Members
Methods
FromEventProperty<TEvent>(Expression<Func<TEvent, TChildReadModel>>)
Defines the event and property on it that the child should be created as a value from.
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.
IdentifiedBy(PropertyPath)
Sets the property that identifies the child read model in the collection within the parent.
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.
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.