Hexalith.EventStore.Contracts 3.15.1

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

Quickstart demo: Aspire dashboard showing services running, a command sent via Swagger UI, and the resulting event in the event stream

Hexalith.EventStore — DAPR-native event sourcing server for .NET

GitHub stars NuGet Build Docs License: MIT

If you've spent weeks wiring up an event store, a message broker, multi-tenant isolation, and a read-model refresh story — only to realize you'll do it again for your next project — we built this for you. Hexalith.EventStore is a distributed, CQRS and DDD-ready event sourcing framework that handles command routing, event persistence, snapshots, query execution, and pub/sub delivery so you can focus on domain logic. Built on DAPR for infrastructure portability.

The Programming Model

Your domain logic lives in an aggregate class with typed Handle methods — conceptually a pure function: $(Command, CurrentState?) \rightarrow List<DomainEvent>$. Each Handle method receives a specific command and the current state, then returns a DomainResult carrying success events or rejections.

public sealed class CounterAggregate : EventStoreAggregate<CounterState>
{
    public static DomainResult Handle(IncrementCounter command, CounterState? state)
        => DomainResult.Success(new IEventPayload[] { new CounterIncremented() });

    public static DomainResult Handle(DecrementCounter command, CounterState? state)
    {
        if ((state?.Count ?? 0) == 0)
            return DomainResult.Rejection(new IRejectionEvent[] { new CounterCannotGoNegative() });
        return DomainResult.Success(new IEventPayload[] { new CounterDecremented() });
    }

    public static DomainResult Handle(ResetCounter command, CounterState? state)
    {
        if ((state?.Count ?? 0) == 0)
            return DomainResult.NoOp();
        return DomainResult.Success(new IEventPayload[] { new CounterReset() });
    }
}

public sealed class CounterState
{
    public int Count { get; private set; }
    public void Apply(CounterIncremented e) => Count++;
    public void Apply(CounterDecremented e) => Count--;
    public void Apply(CounterReset e) => Count = 0;
}

Under the hood, EventStoreAggregate<TState> implements IDomainProcessor — you can still use that interface directly for advanced scenarios (see the legacy CounterProcessor example).

Why Hexalith?

Feature Hexalith Marten EventStoreDB Custom
Infrastructure portability Any store/broker, zero-code swap PostgreSQL only Dedicated server You build it
Multi-tenant isolation Built-in: data, topics, access Manual Manual You build it
CQRS/ES framework Complete, infra-agnostic Complete, PG-coupled Storage only, BYO framework You build it
Deployment DAPR sidecar: Docker, K8s, ACA App library Server + clients You build it
Database lock-in None (Redis, PG, Cosmos, etc.) PostgreSQL EventStoreDB Chosen DB

Note: Hexalith is not the right tool for every scenario. If you need raw event stream performance or already run PostgreSQL everywhere, see the decision aid.

Get Started

Register the event store in two lines — AddEventStore() scans your assembly for aggregate types, no manual registration needed:

builder.Services.AddEventStore();  // Auto-discovers CounterAggregate
// ...
app.UseEventStore();               // Activates domains with convention-derived names

Beyond commands, the platform includes a query pipeline with ETag-based cache validation, projection invalidation hooks, preflight authorization endpoints, and optional SignalR notifications for real-time read-model refresh.

Get started in under 10 minutes — follow the Quickstart Guide.

Prerequisites: .NET SDK, Docker Desktop, DAPR CLI

Architecture

flowchart TB
    Client([Client Application]) -->|REST commands + queries| CommandAPI[Command API Gateway]
    Realtime[Realtime UI / Client] <-.->|SignalR change notifications| CommandAPI
    CommandAPI -->|Route command| Actor[Aggregate Actor]
    Actor -->|Invoke| Domain[Domain Service<br/>IDomainProcessor]
    Domain -->|Return events| Actor
    Actor -->|Persist| StateStore[(State Store<br/>Redis / PostgreSQL / Cosmos DB)]
    Actor -->|Publish| PubSub{{Pub/Sub<br/>RabbitMQ / Kafka / Azure Service Bus}}
    PubSub -->|Subscribe| Projections[Event Handlers / Projections]
    Projections -->|Projection changed| CommandAPI

    subgraph DAPR ["DAPR Sidecar (Infrastructure Abstraction)"]
        StateStore
        PubSub
    end

<details> <summary>Architecture diagram text description</summary>

The system follows a command-event architecture with a built-in read-model refresh path: client applications send commands and queries via REST to the Command API Gateway, which routes commands to Aggregate Actors and queries to projection handlers. Each actor invokes the domain service (your IDomainProcessor implementation) and persists resulting events to a state store. Events are published to a pub/sub system for downstream consumers, and projection changes can be surfaced back to clients through HTTP cache validators and optional SignalR notifications. DAPR provides the infrastructure abstraction layer, allowing you to swap state stores (Redis, PostgreSQL, Cosmos DB) and message brokers (RabbitMQ, Kafka, Azure Service Bus) without changing application code.

</details>

Documentation

Full documentation index: Documentation

Getting Started

Concepts

Guides

Reference

Community

Contributing

Contributions are welcome! Please read the Contributing Guide and Code of Conduct before submitting a pull request.

License

This project is licensed under the MIT License.

See the Changelog for release history and notable changes.

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 Hexalith.EventStore.Contracts:

Package Downloads
Hexalith.Tenants.Contracts

Multi-tenant management service for .NET built on Hexalith.EventStore

Hexalith.EventStore.Client

Multi-tenant client SDK for the Hexalith event store — domain processor registration, assembly scanning, and fluent configuration for .NET event sourcing with DAPR

Hexalith.EventStore.Server

Distributed event sourcing server for .NET — DAPR actor-based command processing, event persistence, and pub/sub for the Hexalith event store

Hexalith.EventStore.Admin.Abstractions

Admin service interfaces and DTOs for Hexalith.EventStore — shared contract for Web UI, CLI, and MCP

Hexalith.EventStore.Admin.Server

DAPR-backed admin service implementations for Hexalith.EventStore — shared backend for Web UI, CLI, and MCP

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.15.1 41 5/9/2026
3.15.0 40 5/9/2026
3.14.2 48 5/9/2026
3.14.1 65 5/7/2026
3.14.0 61 5/7/2026
3.13.5 65 5/7/2026
3.13.4 75 5/7/2026
3.13.3 92 5/6/2026
3.13.2 119 5/6/2026
3.13.1 131 5/6/2026
3.13.0 146 5/5/2026
3.12.0 139 5/5/2026
3.11.1 141 5/5/2026
3.11.0 139 5/5/2026
3.10.0 142 5/5/2026
3.9.1 161 5/4/2026
3.9.0 173 5/3/2026
3.8.0 158 5/3/2026
3.7.0 160 5/3/2026
3.6.0 156 5/3/2026
Loading failed