Zonit.Extensions.Tenants
10.0.0-preview.9
dotnet add package Zonit.Extensions.Tenants --version 10.0.0-preview.9
NuGet\Install-Package Zonit.Extensions.Tenants -Version 10.0.0-preview.9
<PackageReference Include="Zonit.Extensions.Tenants" Version="10.0.0-preview.9" />
<PackageVersion Include="Zonit.Extensions.Tenants" Version="10.0.0-preview.9" />
<PackageReference Include="Zonit.Extensions.Tenants" />
paket add Zonit.Extensions.Tenants --version 10.0.0-preview.9
#r "nuget: Zonit.Extensions.Tenants, 10.0.0-preview.9"
#:package Zonit.Extensions.Tenants@10.0.0-preview.9
#addin nuget:?package=Zonit.Extensions.Tenants&version=10.0.0-preview.9&prerelease
#tool nuget:?package=Zonit.Extensions.Tenants&version=10.0.0-preview.9&prerelease
Zonit.Extensions.Tenants
Per-domain tenant settings + plugin-aware configuration system for Zonit applications.
What it gives you
Tenantrecord — id + domain + persisted setting overrides (JSON blobs in a frozen dictionary, O(1) lookup).Setting<TModel>— abstract base for any setting. Plugins (Areas) ship a class deriving from this with their own model class (POCO + DataAnnotations).ITenantProvider— read API. Strongly-typed access via auto-generatedSettings.{Site,Theme,Maintenance,SocialMedia}plus open-typedGetSetting<TSetting>()for plugin settings.ITenantSource— consumer-side data source contract. Implement against your DB / cache / remote API. The middleware resolves tenants by host name (case-insensitive) on the first non-static request of each scope.TenantMiddleware— wired automatically byUseWebsite(); static-asset bypass + lazy hydration.- Built-in settings —
SiteSetting,ThemeSetting,MaintenanceSetting,SocialMediaSetting. All AOT-safe via source-generatedJsonSerializerContext.
Plugin recipe
// 1. Define your model — vanilla POCO, DataAnnotations welcome.
public sealed class MyPluginModel
{
[Required, StringLength(50, MinimumLength = 1)]
public string Caption { get; set; } = "Hello";
}
// 2. Define your setting + AOT-safe Hydrate.
public sealed class MyPluginSetting : Setting<MyPluginModel>
{
public override string Key => "my_plugin";
public override string Name => "My Plugin";
public override string Description => "Plugin-specific options.";
public override MyPluginModel Hydrate(string json)
=> JsonSerializer.Deserialize(json, MyPluginJsonContext.Default.MyPluginModel) ?? new();
}
[JsonSerializable(typeof(MyPluginModel))]
internal partial class MyPluginJsonContext : JsonSerializerContext;
Now tenantProvider.GetSetting<MyPluginSetting>().Value.Caption works in any Razor page or component. Built-in settings additionally appear on the auto-generated tenantProvider.Settings.{PluginName} facade.
Lifetime
ITenantRepository—Scoped. Per-request snapshot, no cross-request cache.ITenantProvider—Scoped. Caches hydrated settings per scope; invalidated on tenant change.ITenantSource— your impl, recommendedScoped. Add caching here if needed (decorator overIMemoryCache/IDistributedCache).
AOT / trimming
Fully compatible. Hydration uses JsonSerializerContext (source-generated), no reflection on hot paths, no [UnconditionalSuppressMessage] in this package.
| Product | Versions 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. |
-
net10.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.2)
- Zonit.Extensions (>= 10.0.0-preview.9)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Zonit.Extensions.Tenants:
| Package | Downloads |
|---|---|
|
Zonit.Extensions.Website
ASP.NET Core and Blazor web extensions providing base components (PageBase, PageEditBase, PageViewBase), navigation services, breadcrumbs management, toast notifications, cookie handling, and data protection utilities for building modern web applications. |
|
|
Zonit.Extensions.Tenants.Web
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.0.0-preview.9 | 52 | 5/16/2026 |
| 1.0.50 | 463 | 11/18/2025 |
| 1.0.15 | 197 | 10/27/2025 |
| 1.0.14 | 194 | 10/27/2025 |
| 1.0.13 | 195 | 10/27/2025 |
| 1.0.12 | 201 | 10/27/2025 |
| 1.0.11 | 195 | 10/26/2025 |
| 1.0.10 | 234 | 8/29/2025 |
| 1.0.9 | 589 | 7/22/2025 |
| 1.0.8 | 318 | 6/13/2025 |
| 1.0.7 | 338 | 6/11/2025 |
| 1.0.6 | 345 | 6/10/2025 |
| 1.0.5 | 325 | 6/10/2025 |
| 1.0.4 | 322 | 6/9/2025 |
| 1.0.3 | 321 | 6/9/2025 |
| 1.0.2 | 315 | 6/9/2025 |
| 1.0.1 | 288 | 6/9/2025 |
| 1.0.0 | 281 | 6/9/2025 |