Memoria.Messaging.ServiceBus 2.0.0

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

Memoriaβ„’

Build NuGet Downloads Licence

Event sourcing for .NET with two consistency models in one framework. Store state as classic event streams, or as dynamic consistency boundaries where the boundary is a tag query chosen per decision. Start with the mediator alone and add an event store when you need one β€” nothing forces you to take both.

From Latin memoria (memory).

πŸ“˜ Documentation Β· πŸš€ Getting started Β· πŸ’‘ Concepts Β· 🧭 Guides Β· πŸ“— Reference

πŸ“š Examples Β· ⬆️ Upgrading Β· πŸ“£ Release notes

πŸ“„ Licence at a glance

The framework is free and open source under the Apache License 2.0 β€” every package under the Memoria NuGet prefix, every version. Use it in anything, commercial or not, closed source or open, at any scale. No edition, no threshold, no key, nothing to sign.

StateLens, the browser tool that reads a store through your own domain assemblies and a manifest, is a separate product developed in its own repository: commercial, free for a single service and paid above that, under its own licence. Nothing in this repository is part of it, and installing the packages never requires it.

Already on 1.x? Upgrade to 2.0.0 walks through the two behaviours that move with the major version. Nothing in the store changes, so there is no data migration.

πŸ“₯ Install

dotnet add package Memoria

Only Memoria is required. Add an event-sourcing package and a store when you need one:

dotnet add package Memoria.EventSourcing
dotnet add package Memoria.EventSourcing.Store.EntityFrameworkCore

The install guide explains when to reach for each of the packages listed below.

πŸ”„ Quickstart

Register what you need at startup:

services.AddMemoria(typeof(Program));                    // Mediator: commands, queries, notifications
services.AddMemoriaEventSourcing(typeof(Program));       // Aggregates, streams, projections
services.AddMemoriaEntityFrameworkCore<MyDbContext>();   // Store

As a mediator

public record CreateProduct(string Name) : ICommand;

public class CreateProductHandler : ICommandHandler<CreateProduct>
{
    public Task<Result> Handle(CreateProduct command, CancellationToken cancellationToken = default) =>
        Task.FromResult(Result.Ok());
}

await dispatcher.Send(new CreateProduct("Espresso"));

See the Mediator quickstart for queries, notifications, validation, custom handlers, command sequences and SendAndPublish.

As an event store

[EventType("OrderPlaced")]
public record OrderPlacedEvent(Guid OrderId, decimal Amount) : IEvent;

var streamId = new CustomerStreamId(customerId);
var aggregateId = new OrderId(orderId);
var order = new Order(orderId, amount: 25.45m);

await domainService.SaveAggregate(streamId, aggregateId, order, expectedEventSequence: 0);

See the Event Sourcing quickstart for the full aggregate definition, and Streams or DCB? for choosing a consistency model.

Past that, the guides cover one task each, and the reference has the IDomainService API and a configuration page per package.

⚑ What you get

Area Capabilities
Mediator Commands, queries and notifications through one IDispatcher; command sequences; custom handlers in place of the resolved one; automatic notification publication after a command succeeds; Result instead of exceptions
Consistency Event streams with optimistic concurrency on an expected event sequence, or dynamic consistency boundaries where the boundary is a tag query chosen per decision; multiple aggregates per stream
Reads Four read modes; aggregate snapshots stored alongside events for fast, strongly consistent reads; projections persisted and retrieved as snapshots; in-memory reconstruction up to a given sequence or date
Event queries Filter applied events by event type, or by event property declared as key/value pairs on the aggregate id; query stream events from or up to a sequence, date or date range; retrieve every event applied to an aggregate
Providers Stores: EF Core (plus ASP.NET Identity and PostgreSQL jsonb companions), Cosmos DB. Messaging: Azure Service Bus, RabbitMQ. Caching: in-memory, Redis. Validation: FluentValidation
Testing In-memory variants of Cosmos DB, Service Bus and RabbitMQ, so a test suite needs no external dependency
Tooling StateLens β€” a separate browser tool that reads any framework's store through your own domain assemblies and a manifest

πŸ”Ž StateLens

StateLens is a browser tool for reading an event sourced store. Point it at a store, upload a zip of your own domain assemblies β€” with a statelens.json at its root naming the services in it β€” and it shows you the events that were appended, the aggregates and projections snapshotted from them, and the types both were written through. Open a row and the aggregate is folded from its events, so you can see the state a snapshot stands at and how far behind its history it is. It creates nothing and deletes nothing.

It began here, as Memoria Web, a reader of Memoria stores. It lives in its own repository now, which is private, and reads any framework's store, not only Memoria's: a service's manifest tells the tool which uploaded types are the streams, events, aggregates and projections, how they are named and folded, and where in the store the events and snapshots are. Memoria's own stores are described the same way as anyone else's.

It is a commercial product, separate from the framework: free over a single service, and paid above that, under the StateLens Licence. Its documentation is on its site, and a hosted instance at demo.statelens.dev is open by invitation, asked for through the site's contact form.

πŸ“¦ Packages

Every package is published at the same version, so one number fits the whole set.

Package Version What it adds
Memoria NuGet Required. Mediator core: commands, queries, notifications, dispatcher
Memoria.EventSourcing NuGet Aggregates, streams, projections and IDomainService
Memoria.EventSourcing.Dcb NuGet Dynamic consistency boundaries
Memoria.EventSourcing.Dcb.Store.EntityFrameworkCore NuGet EF Core store for the DCB model
Memoria.EventSourcing.Store.EntityFrameworkCore NuGet EF Core store: SQL Server, SQLite, PostgreSQL, MySQL, in-memory
Memoria.EventSourcing.Store.EntityFrameworkCore.Identity NuGet The above, plus ASP.NET Core Identity in the same DbContext
Memoria.EventSourcing.Store.EntityFrameworkCore.Npgsql NuGet PostgreSQL jsonb-aware event-property filtering
Memoria.EventSourcing.Store.Cosmos NuGet Azure Cosmos DB store (SQL API)
Memoria.EventSourcing.Store.Cosmos.InMemory NuGet In-process Cosmos DB stand-in for tests
Memoria.Messaging.ServiceBus NuGet Publish to Azure Service Bus when a command succeeds
Memoria.Messaging.ServiceBus.InMemory NuGet In-process Service Bus stand-in for tests
Memoria.Messaging.RabbitMq NuGet Publish to RabbitMQ when a command succeeds
Memoria.Messaging.RabbitMq.InMemory NuGet In-process RabbitMQ stand-in for tests
Memoria.Caching.Memory NuGet Cache query results in-process
Memoria.Caching.Redis NuGet Cache query results in Redis
Memoria.Validation.FluentValidation NuGet Validate commands before they reach the handler

πŸ—ΊοΈ Roadmap

Shipped work is in the release notes. Next up, in no fixed order:

  • Pipelines
  • Option to automatically validate commands
  • Event Grid messaging provider
  • Kafka messaging provider
  • Amazon SQS messaging provider
  • File store provider for event sourcing

🀝 Contributing

Bug reports, questions and feature requests are welcome as issues and discussions. For code, please open an issue first, and read CONTRIBUTING.md β€” it covers how to build and test and the conventions to follow. There is nothing to sign: the framework is Apache 2.0, and a contribution comes in under the same terms it goes out under.

By taking part you agree to the Code of Conduct.

⭐ Give a star

If Memoria is useful in your learning, samples, workshop or project, please give the repository a star. Thank you!

✨ Custom implementations and project support

Memoria is designed to be extended, with providers for store, messaging, caching and validation.

Need a provider that does not exist yet β€” a custom database store, a different message bus β€” or help applying Memoria to an existing codebase? Get in touch via LinkedIn.

πŸ“„ Licence

The framework is under the Apache License 2.0 β€” every package published under the Memoria NuGet prefix, every version, 1.x and 2.x alike. Build whatever you like with it, licence that however you like, ship it to whomever you like. The full text is in LICENSE.md.

StateLens is a commercial product, developed in its own private repository and licensed separately under the StateLens Licence. Running it is what the licence governs, metered by services β€” a named set of domain assemblies read over one connection string. One service is free, and always will be; above that it is priced by how many services one instance reads, on the tool's pricing page, with no limit on people, instances or environments. Nothing of it is in this repository.

Version 2.0.0-beta was briefly offered under the Reciprocal Public License 1.5 or a commercial licence covering the packages. That was withdrawn four days later at 2.0.0-beta.2, the framework returned to Apache 2.0, where it had been throughout 1.x, and 2.0.0 shipped under it. Anyone who took 2.0.0-beta under the earlier terms keeps them; Apache 2.0 grants strictly more.

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
2.0.0 72 10/7/2026
2.0.0-beta.2 59 9/21/2026
2.0.0-beta 95 9/16/2026
1.9.1 113 9/13/2026
1.9.0 102 9/12/2026
1.8.0 123 9/4/2026
1.8.0-beta-2 102 9/3/2026
1.8.0-beta 101 9/2/2026
1.7.0 112 8/31/2026
1.6.0 109 8/30/2026
1.5.0 115 8/29/2026
1.4.1 113 8/25/2026
1.4.0 109 8/23/2026
1.3.2 138 5/16/2026
1.3.1 133 5/13/2026
1.3.0 118 5/13/2026
1.2.1 129 5/12/2026
1.2.0 135 5/10/2026
1.1.0 164 2/1/2026
1.0.0 208 10/10/2025