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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="JorgeCostaMacia.Aggregate" Version="6.0.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="JorgeCostaMacia.Aggregate" Version="6.0.4" />
                    
Directory.Packages.props
<PackageReference Include="JorgeCostaMacia.Aggregate" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add JorgeCostaMacia.Aggregate --version 6.0.4
                    
#r "nuget: JorgeCostaMacia.Aggregate, 6.0.4"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package JorgeCostaMacia.Aggregate@6.0.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=JorgeCostaMacia.Aggregate&version=6.0.4
                    
Install as a Cake Addin
#tool nuget:?package=JorgeCostaMacia.Aggregate&version=6.0.4
                    
Install as a Cake Tool

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.

NuGet Downloads Build License


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.

Author: Jorge Costa Maciá

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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