Excalibur.MultiTenancy 10.0.0-alpha.4

This is a prerelease version of Excalibur.MultiTenancy.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Excalibur.MultiTenancy --version 10.0.0-alpha.4
                    
NuGet\Install-Package Excalibur.MultiTenancy -Version 10.0.0-alpha.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="Excalibur.MultiTenancy" Version="10.0.0-alpha.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Excalibur.MultiTenancy" Version="10.0.0-alpha.4" />
                    
Directory.Packages.props
<PackageReference Include="Excalibur.MultiTenancy" />
                    
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 Excalibur.MultiTenancy --version 10.0.0-alpha.4
                    
#r "nuget: Excalibur.MultiTenancy, 10.0.0-alpha.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 Excalibur.MultiTenancy@10.0.0-alpha.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=Excalibur.MultiTenancy&version=10.0.0-alpha.4&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Excalibur.MultiTenancy&version=10.0.0-alpha.4&prerelease
                    
Install as a Cake Tool

Excalibur.MultiTenancy

First-class, free multi-tenancy composition for Excalibur. One AddMultiTenancy(...) call selects a tenant-isolation strategy and wires fail-closed tenant scoping consistently across the event store, projections, and sagas.

Strategies

  • Row-discriminator — a single shared store per subsystem with a TenantId predicate applied inside every query. AddMultiTenancy wraps each registered IEventStore, IProjectionStore<T>, and ISagaStore with its fail-closed tenant-scoping decorator: an operation with no ambient tenant throws rather than running unscoped.
  • Sharding — a dedicated store per tenant, selected per operation by tenant-aware routing. AddMultiTenancy(Sharding) registers tenant routing (the same wiring EnableTenantSharding(...) uses) and enforces the ambient-tenant requirement. The consumer supplies the shard map and provider-specific store resolvers.

Usage

Register your persistence stores first, then compose multi-tenancy:

services.AddExcalibur(x => x.AddEventSourcing(es =>
{
    es.UseSqlServer(sql => sql.ConnectionString(connectionString));
    es.AddRepository<Order, Guid>(id => new Order(id));
}));

// Row-discriminator: shared store, TenantId predicate, fail-closed decorators.
services.AddMultiTenancy(o => o.Strategy = TenantIsolationStrategy.RowDiscriminator);

The ambient tenant is required on every tenant-facing operation. Establish it per logical operation from the host — for example, a request middleware:

app.Use(async (context, next) =>
{
    var tenant = context.Request.Headers["X-Tenant-Id"].FirstOrDefault();
    using (TenantContextHolder.BeginScope(tenant))
    {
        await next().ConfigureAwait(false);
    }
});

For the sharding strategy, register the shard map and a provider-specific store resolver, then compose. AddMultiTenancy(Sharding) registers tenant routing for you:

services.AddExcalibur(x => x.AddEventSourcing(es =>
{
    es.UseSqlServerTenantEventStore(); // registers ITenantStoreResolver<IEventStore> + shard map
}));

services.AddMultiTenancy(o => o.Strategy = TenantIsolationStrategy.Sharding);
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
10.0.0-alpha.21 68 11/1/2026
10.0.0-alpha.20 64 10/30/2026
10.0.0-alpha.19 60 10/27/2026
10.0.0-alpha.18 63 10/25/2026
10.0.0-alpha.17 64 10/23/2026
10.0.0-alpha.16 69 10/21/2026
10.0.0-alpha.15 59 10/11/2026
10.0.0-alpha.14 85 10/2/2026
10.0.0-alpha.13 67 9/29/2026
10.0.0-alpha.12 72 9/25/2026
10.0.0-alpha.11 64 9/15/2026
10.0.0-alpha.10 91 9/6/2026
10.0.0-alpha.9 85 8/31/2026
10.0.0-alpha.8 101 8/14/2026
10.0.0-alpha.7 90 8/13/2026
10.0.0-alpha.6 97 8/11/2026
10.0.0-alpha.5 87 8/10/2026
10.0.0-alpha.4 96 8/10/2026

See CHANGELOG.md for release notes