Skip to content

Release v2.11.0

Compare
Choose a tag to compare
@github-actions github-actions released this 08 Nov 09:50
09661ba

Summary

This PR brings in the ability to have children on models based on events.
When using the C# client API you'll find it as this:

[Projection("8fdaaf0d-1291-47b7-b661-2eeba340a520")]
public class AccountsOverviewProjection : IProjectionFor<AccountsOverview>
{
    public void Define(IProjectionBuilderFor<AccountsOverview> builder)
    {
        builder
            .Children(_ => _.DebitAccounts, _ => _
                .IdentifiedBy(_ => _.Id)
                .From<DebitAccountOpened>(_ => _
                    .UsingParentKey(_ => _.Owner)
                    .Set(_ => _.Name).To(_ => _.Name)));
    }
}

You model the relationship by telling what is the property on the model that identifies every child, this is to be able to do the correct operation (Add, Remove, Update) on a child. The Event needs to have a property on it that identifies the parent object; the key. As a child relationship is considered a child projection, you have the same capabilities on a child as on a parent.

Added

  • Support for children on objects in projections.

Fixed

  • Internal restructuring for extensibility and improved maintainability across the board.