Nagare 0.6.4

dotnet add package Nagare --version 0.6.4
                    
NuGet\Install-Package Nagare -Version 0.6.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="Nagare" Version="0.6.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Nagare" Version="0.6.4" />
                    
Directory.Packages.props
<PackageReference Include="Nagare" />
                    
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 Nagare --version 0.6.4
                    
#r "nuget: Nagare, 0.6.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 Nagare@0.6.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=Nagare&version=0.6.4
                    
Install as a Cake Addin
#tool nuget:?package=Nagare&version=0.6.4
                    
Install as a Cake Tool

Nagare 流れ

Event sourcing for .NET — flow in, truth out.


Events are the natural language of change. Something happened. Then something else. The stream moves forward, never backward, and the truth is always the whole story.

Nagare is an event sourcing framework for .NET that gets out of your way. Define what your domain means, and let the framework carry the rest.

public class BookAggregate : Aggregate<BookCommand, BookEvent, BookState>
{
    private readonly EventHandlers<BookEvent, BookState> _events =
        new EventHandlersBuilder<BookEvent, BookState>()
            .On<BookAdded>((state, e) =>
                state with { Exists = true, Title = e.Title })
            .On<BookBorrowed>((state, e) =>
                state with { IsBorrowed = true, BorrowerId = e.BorrowerId })
            .Build();

    private readonly CommandHandlers<BookCommand, BookEvent, BookState> _commands =
        new CommandHandlersBuilder<BookCommand, BookEvent, BookState>()
            .On<AddBook>((state, cmd) =>
                state.Exists
                    ? Then.Reject("Book already exists")
                    : Then.Persist(new BookAdded(cmd.Title, cmd.Author, cmd.Isbn)))
            .On<BorrowBook>((state, cmd) =>
                !state.Exists      ? Then.Reject("Book does not exist")
                : state.IsBorrowed ? Then.Reject("Book is already borrowed")
                : Then.Persist(new BookBorrowed(cmd.BorrowerId, DateTimeOffset.UtcNow)))
            .Build();

    protected override EventHandlers<BookEvent, BookState> RegisterEventHandlers() => _events;

    protected override CommandHandlers<BookCommand, BookEvent, BookState> RegisterCommandHandlers() => _commands;
}

Commands say what you want. Events say what happened. State is what's true right now. That's it.


Test like you think

harness
    .Given(new BookAdded("Dune", "Herbert", "978-0441172719"))
    .When(new BorrowBook("user-42"))
    .ThenAccepted()
    .ThenExpect<BookBorrowed>(e => e.BorrowerId == "user-42");
harness
    .Given(new BookAdded(...), new BookBorrowed(...))
    .When(new BorrowBook("user-99"))
    .ThenRejected("already borrowed");

No database. No DI container. Just the domain, speaking for itself.


Packages

Package NuGet Purpose
Nagare NuGet Core — aggregates, events, projections, subscriptions
Nagare.SqlServer NuGet SQL Server stores
Nagare.Sqlite NuGet SQLite stores
Nagare.PostgreSql NuGet PostgreSQL stores
Nagare.MySql NuGet MySQL stores
Nagare.Messaging NuGet Pub/sub messaging abstractions
Nagare.Messaging.Kafka NuGet Kafka implementation
Nagare.Testing NuGet Given-When-Then harness, Eventually for projection polling

Claude Code plugin

Nagare ships a Claude Code plugin with skills for aggregate design, event naming, projections, testing, and store adapters.

# Add the marketplace
/plugin marketplace add gideondk/nagare

# Install the plugin
/plugin install nagare@gideondk-nagare

# Reload to activate
/reload-plugins

Get started

builder.Services.AddNagare();
builder.Services.AddAggregate<BookAggregate, BookCommand, BookEvent, BookState>();

See samples/Nagare.Samples.Library for a complete example, or read the full documentation.


Nagare (流れ) — the flow of water, the passage of time, the course of events.

Product Compatible and additional computed target framework versions.
.NET 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 (7)

Showing the top 5 NuGet packages that depend on Nagare:

Package Downloads
Nagare.Messaging

Broker-agnostic messaging abstractions for Nagare event sourcing

Nagare.Sqlite

SQLite persistence for Nagare event sourcing

Nagare.PostgreSql

PostgreSQL persistence for Nagare event sourcing

Nagare.Testing

In-memory test doubles and shared test bases for Nagare event sourcing

Nagare.MySql

MySQL persistence for Nagare event sourcing

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.6.4 18 4/4/2026
0.6.3 42 4/3/2026
0.6.2 279 3/27/2026
0.6.1 132 3/26/2026
0.6.0 146 3/22/2026
0.5.0 129 3/22/2026
0.4.1 132 3/19/2026
0.4.0 170 3/19/2026
0.3.0 129 3/19/2026
0.2.0 138 3/18/2026
0.1.0 144 3/18/2026