Zerra.Repository.KurrentDB 6.0.0-rc.1

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

Zerra.Repository.KurrentDB

KurrentDB event store provider for Zerra.Repository, for event-sourced aggregates.

Installation

dotnet add package Zerra.Repository.KurrentDB

Usage

using Zerra.Repository;
using Zerra.Repository.KurrentDB;
using Zerra.Repository.Memory;

// insecure: true for a server without TLS; MemoryEngine is a fallback when KurrentDB isn't running
IEventStoreEngine eventStore = KurrentDBConnectionTest.Test(connectionString, insecure: true, log: log)
    ? new KurrentDBEngine(connectionString, insecure: true)
    : new MemoryEngine();

var busServices = new BusServices();
busServices.AddService<IEventStoreEngine>(eventStore);

An AggregateRoot keeps its state as a stream of events. Each event implements IAggregateEvent and is applied by a public On method:

public sealed class CartAggregate : AggregateRoot
{
    private readonly List<CartItem> items = new();
    public IReadOnlyList<CartItem> Items => items;

    public CartAggregate(Guid customerID, IEventStoreEngine eventStore) : base(customerID, eventStore) { }

    public Task On(CartItemAddedEvent @event)
    {
        items.Add(new CartItem { ProductID = @event.ProductID, Quantity = @event.Quantity });
        return Task.CompletedTask;
    }
}

// in a command handler
var cart = new CartAggregate(command.CustomerID, Context.GetService<IEventStoreEngine>());
await cart.Rebuild();
await cart.Append(new CartItemAddedEvent { ProductID = command.ProductID, Quantity = command.Quantity }, validateEventNumber: true);

validateEventNumber: true rejects the append if another command changed the stream since this instance rebuilt it.

Documentation

License

MIT - See LICENSE

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

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.0-rc.1 39 10/27/2026