Skip to content
Wouter Naessens edited this page Oct 24, 2026 · 24 revisions

Aggregates

Aggregates is a .NET 10 library that provides all the boilerplate for event sourcing, leaving you with just the core domain logic to write. It is built around functional event sourcing principles and covers the full reactive stack: aggregates, sagas, policies, and projections.


Packages

Core:

Package Description
Aggregates Commands, aggregates, unit of work, command handler decorator chain
Aggregates.Subscriptions Shared abstractions: ICheckpointStore, ISubscription, ISubscriptionFactory, IParkedMessageSink, IParkedMessages
Aggregates.Sagas Saga pattern: stateful event-driven process managers
Aggregates.Policies Policy pattern: stateless event-driven command dispatchers
Aggregates.Projections Projection pattern: event-driven read-model builders

Storage integrations (one required):

Package Description
Aggregates.KurrentDB KurrentDB aggregate persistence
Aggregates.Sagas.KurrentDB KurrentDB saga storage + subscriptions
Aggregates.Policies.KurrentDB KurrentDB policy subscriptions
Aggregates.Projections.KurrentDB KurrentDB projection subscriptions
Aggregates.KurrentDB.Migration Imports 0.x persistent subscription positions as 1.0 checkpoints (switch-over only)
Aggregates.MSSP MSSP aggregate persistence
Aggregates.Sagas.MSSP MSSP saga storage + subscriptions
Aggregates.Policies.MSSP MSSP policy subscriptions
Aggregates.Projections.MSSP MSSP projection subscriptions

Projection commit helpers:

Package Description
Aggregates.Projections.Sql SQL projection commits via ADO.NET

Core concepts in thirty seconds

Event sourcing stores what happened rather than what is. The current state of anything is the result of replaying a sequence of past events.

Two functions are all you need:

state × event   →  state      (apply an event — always succeeds)
state × command →  events[]   (handle a command — may fail)

The library gives you the scaffolding. You implement the two functions for your domain.


Pages

  • Getting Started — install, wire up, and write your first aggregate, saga, policy, and projection
  • State is a Projection — why aggregates have no single state object, and how to use multiple state representations on the same event stream
  • Architecture — functional event sourcing model, decorator chains, unit of work, subscription infrastructure
  • API Reference — complete reference for all public types, interfaces, and attributes

Clone this wiki locally