Interface IChildrenBuilder<TParentModel, TChildModel>
- Namespace
- Cratis.Chronicle.Projections
- Assembly
- Cratis.Chronicle.dll
Defines the builder for building out a child relationship on a model.
public interface IChildrenBuilder<TParentModel, TChildModel> : IProjectionBuilder<TChildModel, IChildrenBuilder<TParentModel, TChildModel>>, IChildrenBuilder
Type Parameters
TParentModel
Parent model type.
TChildModel
Child model type.
- Inherited Members
Methods
FromEventProperty<TEvent>(Expression<Func<TEvent, TChildModel>>)
Defines the event and property on it that the child should be created as a value from.
IChildrenBuilder<TParentModel, TChildModel> FromEventProperty<TEvent>(Expression<Func<TEvent, TChildModel>> propertyExpression)
Parameters
propertyExpression
Expression<Func<TEvent, TChildModel>>The expression that represents the property on the event to use.
Returns
- IChildrenBuilder<TParentModel, TChildModel>
Builder continuation.
Type Parameters
TEvent
Type of event.
IdentifiedBy(PropertyPath)
Sets the property that identifies the child model in the collection within the parent.
IChildrenBuilder<TParentModel, TChildModel> IdentifiedBy(PropertyPath propertyPath)
Parameters
propertyPath
PropertyPathThe Cratis.Chronicle.Properties.PropertyPath that represents the property used to identify.
Returns
- IChildrenBuilder<TParentModel, TChildModel>
Builder continuation.
IdentifiedBy<TProperty>(Expression<Func<TChildModel, TProperty>>)
Sets the property that identifies the child model in the collection within the parent.
IChildrenBuilder<TParentModel, TChildModel> IdentifiedBy<TProperty>(Expression<Func<TChildModel, TProperty>> propertyExpression)
Parameters
propertyExpression
Expression<Func<TChildModel, TProperty>>The expression that represents the property used to identify.
Returns
- IChildrenBuilder<TParentModel, TChildModel>
Builder continuation.
Type Parameters
TProperty
Type of property.