The foundation: tenant resolution, tenant stores, per-tenant options, and running work as a tenant in any .NET app.
MultiTenant is the core the other packages build on. It resolves the tenant from any context, tracks the current tenant, and lets the rest of your app vary by tenant through standard dependency injection and options.
Use it on its own in worker services, queue consumers, and console apps, or add the ASP.NET Core, Entity Framework Core, and Identity packages on top.
dotnet add package Finbuckle.MultiTenant
builder.Services.AddMultiTenant<AppTenantInfo, string>()
.WithDelegateStrategy<QueueMessage, AppTenantInfo, string>(
message => Task.FromResult<string?>(message.Tenant))
.WithConfigurationStore();Releases
| Version | Targets | Released | Release notes |
|---|---|---|---|
| v11.0.0New | .NET 11 | Nov 24, 2026 | Release notes |
| v10.2.0 | .NET 10 | Nov 12, 2026 | Release notes |
| v9.4.16 | .NET 8 and 9 | Nov 10, 2026 | Release notes |
| v8.1.21 | .NET 6, 7, and 8 | Nov 10, 2026 | Release notes |
Model tenants your way
A tenant is any class that implements ITenantInfo. Start from TenantInfo and add the properties your app needs.
- Choose the tenant ID type: string, int, Guid, or any equatable type.
- Identifiers can change; IDs never do.
- Keep tenant info small and load heavier data by tenant ID when you need it.
public class AppTenantInfo : TenantInfo<string>
{
public string? Name { get; init; }
public string? Theme { get; init; }
public string? SupportEmail { get; init; }
}
builder.Services.AddMultiTenant<AppTenantInfo, string>();Keep tenant details where they belong
Stores look up tenant details for the identifier a strategy found. Put a cache in front of any store to keep lookups fast.
- Configuration, in-memory, HTTP remote, and echo stores, or write your own.
- Distributed and in-memory caches, invalidated automatically when tenants change.
- TenantManager for adding, updating, and removing tenants at runtime.
builder.Services.AddMultiTenant<AppTenantInfo, string>()
// ...strategies
.WithDistributedCacheStoreCache()
.WithHttpRemoteStore("https://tenants.example.com/{__tenant__}");Vary settings by tenant
Configure any options-pattern type per tenant. Components that already read options pick up the right values for the current tenant without changes.
- PerTenant versions of Configure, ConfigureAll, and PostConfigure.
- Named options and the OptionsBuilder API are supported.
- Works with any options type, including ones from ASP.NET Core and third-party libraries.
builder.Services.ConfigurePerTenant<BrandingOptions, AppTenantInfo, string>(
(options, tenant) =>
{
options.Theme = tenant.Theme;
options.SupportEmail = tenant.SupportEmail;
});Run work as a tenant
Background services, queue consumers, and scheduled jobs can resolve a tenant and run work with that tenant's services and options.
- Delegate strategies resolve a tenant from a message, job, or any object.
- RunInTenantScopeAsync runs work in a fresh DI scope for a tenant.
- The caller's own tenant scope is unchanged when the work finishes.
await services.RunInTenantScopeAsync(tenantInfo, async scoped =>
{
// resolved for this tenant, with its options
var mailer = scoped.GetRequiredService<IInvoiceMailer>();
await mailer.SendOverdueRemindersAsync();
});The rest of the MultiTenant family
MultiTenant Abstractions
Finbuckle.
The shared contracts: tenant info, strategy, store, and tenant context interfaces, with no implementation dependencies.
Learn moreMultiTenant for ASP.NET Core
Finbuckle.
Middleware, request-based strategies, and per-tenant authentication for ASP.NET Core apps.
Learn moreMultiTenant for EF Core
Finbuckle.
Per-tenant data isolation for EF Core, in a shared database, a database per tenant, or a mix of both.
Learn moreMultiTenant Identity
Finbuckle.
Multi-tenant ASP.NET Core Identity: each tenant gets its own users, roles, and passkeys.
Learn more