JorgeCostaMacia.Aggregate
6.0.4
Prefix Reserved
dotnet add package JorgeCostaMacia.Aggregate --version 6.0.4
NuGet\Install-Package JorgeCostaMacia.Aggregate -Version 6.0.4
<PackageReference Include="JorgeCostaMacia.Aggregate" Version="6.0.4" />
<PackageVersion Include="JorgeCostaMacia.Aggregate" Version="6.0.4" />
<PackageReference Include="JorgeCostaMacia.Aggregate" />
paket add JorgeCostaMacia.Aggregate --version 6.0.4
#r "nuget: JorgeCostaMacia.Aggregate, 6.0.4"
#:package JorgeCostaMacia.Aggregate@6.0.4
#addin nuget:?package=JorgeCostaMacia.Aggregate&version=6.0.4
#tool nuget:?package=JorgeCostaMacia.Aggregate&version=6.0.4
JorgeCostaMacia.Aggregate
The DDD Aggregate Root building block: a base class (and IAggregate contract) that accumulates domain events raised during a unit of work, then hands them off — pull-and-clear — for persistence and publication.
Install
dotnet add package JorgeCostaMacia.Aggregate
Usage
using JorgeCostaMacia.Aggregate.Domain;
using JorgeCostaMacia.DomainEvent.Domain;
public sealed class Order : Aggregate
{
public Guid Id { get; init; }
public void Place()
{
// ... mutate state ...
AddEvent(new OrderPlaced(Id));
}
}
// after handling a command, the persistence/publish layer drains the events exactly once:
IEnumerable<IDomainEvent> events = order.PullEvents();
Transport-agnostic by design
The aggregate accumulates IDomainEvent — a pure marker from JorgeCostaMacia.DomainEvent with no knowledge of any bus. A messaging layer specializes it (IEvent : IDomainEvent, ...), so concrete events still fit the aggregate's event list while the domain stays free of any transport dependency.
PullEvents() returns the pending events and clears the internal list, so they are published exactly once per unit of work. Add events with AddEvent(...) (one) or AddEvents(...) (a range).
Requirements
One of the following SDKs: .NET 8 / 9 / 10 (.NET 10 recommended).
Depends on JorgeCostaMacia.DomainEvent.
About
JorgeCostaMacia.Aggregate is part of shared-net — a set of foundational, self-contained .NET packages, each scoped to a single concern and reusable across your bounded contexts.
- Repository: github.com/JorgeCostaMacia/shared-net
- Issues & requests: open an issue
- Contributing: CONTRIBUTING.md
- Security: report a vulnerability
Author: Jorge Costa Maciá
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- JorgeCostaMacia.DomainEvent (>= 6.0.4)
-
net8.0
- JorgeCostaMacia.DomainEvent (>= 6.0.4)
-
net9.0
- JorgeCostaMacia.DomainEvent (>= 6.0.4)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 6.0.4 | 43 | 7/22/2026 |
| 6.0.3 | 42 | 7/22/2026 |
| 6.0.2 | 106 | 7/19/2026 |
| 6.0.1 | 91 | 7/15/2026 |
| 6.0.0 | 93 | 7/13/2026 |
| 5.0.0 | 97 | 7/12/2026 |
| 4.3.0 | 99 | 7/12/2026 |
| 4.2.0 | 95 | 7/11/2026 |
| 4.1.0 | 102 | 7/10/2026 |
| 4.0.0 | 103 | 7/9/2026 |
| 3.0.1 | 93 | 7/8/2026 |
| 2.0.8 | 110 | 7/1/2026 |
| 2.0.7 | 102 | 6/30/2026 |
| 2.0.6 | 98 | 6/30/2026 |
| 2.0.5 | 97 | 6/30/2026 |
| 2.0.4 | 100 | 6/30/2026 |
| 2.0.3 | 102 | 6/30/2026 |
| 2.0.0 | 109 | 6/29/2026 |
| 1.0.1 | 100 | 6/29/2026 |
| 1.0.0 | 105 | 6/29/2026 |