Zonit.Extensions.Tenants 10.0.0-preview.9

This is a prerelease version of Zonit.Extensions.Tenants.
dotnet add package Zonit.Extensions.Tenants --version 10.0.0-preview.9
                    
NuGet\Install-Package Zonit.Extensions.Tenants -Version 10.0.0-preview.9
                    
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="Zonit.Extensions.Tenants" Version="10.0.0-preview.9" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Zonit.Extensions.Tenants" Version="10.0.0-preview.9" />
                    
Directory.Packages.props
<PackageReference Include="Zonit.Extensions.Tenants" />
                    
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 Zonit.Extensions.Tenants --version 10.0.0-preview.9
                    
#r "nuget: Zonit.Extensions.Tenants, 10.0.0-preview.9"
                    
#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 Zonit.Extensions.Tenants@10.0.0-preview.9
                    
#: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=Zonit.Extensions.Tenants&version=10.0.0-preview.9&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Zonit.Extensions.Tenants&version=10.0.0-preview.9&prerelease
                    
Install as a Cake Tool

Zonit.Extensions.Tenants

Per-domain tenant settings + plugin-aware configuration system for Zonit applications.

What it gives you

  • Tenant record — 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-generated Settings.{Site,Theme,Maintenance,SocialMedia} plus open-typed GetSetting<TSetting>() for plugin settings.
  • ITenantSourceconsumer-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 by UseWebsite(); static-asset bypass + lazy hydration.
  • Built-in settingsSiteSetting, ThemeSetting, MaintenanceSetting, SocialMediaSetting. All AOT-safe via source-generated JsonSerializerContext.

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

  • ITenantRepositoryScoped. Per-request snapshot, no cross-request cache.
  • ITenantProviderScoped. Caches hydrated settings per scope; invalidated on tenant change.
  • ITenantSource — your impl, recommended Scoped. Add caching here if needed (decorator over IMemoryCache / IDistributedCache).

AOT / trimming

Fully compatible. Hydration uses JsonSerializerContext (source-generated), no reflection on hot paths, no [UnconditionalSuppressMessage] in this package.

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 (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