MultiTenant Docs

Guides and reference for Finbuckle MultiTenant, versioned to match the packages you install.

Finbuckle Logo MultiTenant 11.0.0

About MultiTenant

MultiTenant is an open source multi-tenancy library for modern .NET created and maintained by Finbuckle LLC. It enables tenant resolution, per-tenant app behavior, and per-tenant data isolation.

See https://www.finbuckle.com/Products for more details and documentation.

This release supports .NET 11.

Beginning with MultiTenant v10, major version releases align with .NET major version releases.

New development focuses on the latest MultiTenant release version while critical security and severe bug fixes will be released for prior versions which target .NET versions supported by Microsoft.

In general, you should target the version of MultiTenant that matches your .NET version.

Open Source Support

Your support helps keep the project going and is greatly appreciated!

MultiTenant is primarily supported by its GitHub sponsors and contributors.

Additional support is provided by the following organizations:

Digital Ocean logo

GitHub logo

Jetbrains logo

License

MultiTenant is licensed differently depending on how you get it:

Open Source Maintenance Fee

Under the Open Source Maintenance Fee EULA, use of the official NuGet packages in revenue-generating activities is subject to the maintenance fee. See pricing for details, including free use for smaller organizations.

Visual Studio asks you to accept the EULA when you install the packages. Other tools such as dotnet add package don't prompt.

Release builds that reference the official packages show warning FBMT0001 until the EULA is accepted. To accept it, set the AcceptFinbuckleEULA property in your project file or Directory.Build.props:

<PropertyGroup>
    <AcceptFinbuckleEULA>true</AcceptFinbuckleEULA>
</PropertyGroup>

It can also be passed on the command line, for example dotnet build -c Release -p:AcceptFinbuckleEULA=true. Builds that treat warnings as errors fail until the property is set.

Verifying Packages

The official NuGet packages are built and published by the NuGet Push Public workflow, which creates a GitHub artifact attestation for each .nupkg, .snupkg, and library assembly. The attestation proves the file was built from this repository by that workflow. Packages released before attestations were added can't be verified this way.

Verification uses the GitHub CLI. Because NuGet.org adds its own repository signature file, .signature.p7s, to every package it publishes, a .nupkg downloaded from NuGet.org doesn't match the attested file until that signature is removed. The assemblies inside the package aren't changed, so they can be verified directly.

Verify an assembly

After a restore, the package's assemblies are in the local NuGet cache (~/.nuget/packages on macOS and Linux, %userprofile%\.nuget\packages on Windows). Replace <version> with the package version:

gh attestation verify ~/.nuget/packages/finbuckle.multitenant/<version>/lib/net11.0/Finbuckle.MultiTenant.dll \
  --repo Finbuckle/Finbuckle.MultiTenant \
  --signer-workflow Finbuckle/Finbuckle.MultiTenant/.github/workflows/nuget-push-public.yml

Verify a package

Download the package from NuGet.org, remove .signature.p7s from a copy, then verify the copy:

curl -L -o Finbuckle.MultiTenant.<version>.nupkg https://www.nuget.org/api/v2/package/Finbuckle.MultiTenant/<version>
zip -d Finbuckle.MultiTenant.<version>.nupkg .signature.p7s
gh attestation verify Finbuckle.MultiTenant.<version>.nupkg \
  --repo Finbuckle/Finbuckle.MultiTenant \
  --signer-workflow Finbuckle/Finbuckle.MultiTenant/.github/workflows/nuget-push-public.yml

On Windows, where zip isn't available, remove the signature with PowerShell 7 instead:

$zip = [System.IO.Compression.ZipFile]::Open("$PWD\Finbuckle.MultiTenant.<version>.nupkg", 'Update')
$zip.GetEntry('.signature.p7s').Delete()
$zip.Dispose()

Removing the signature leaves the rest of the package byte-for-byte as it was built. Don't use the modified copy as a package source, since NuGet can no longer verify its signature.

.NET Foundation

This project is supported by the .NET Foundation.

Code of Conduct

This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. For more information see the .NET Foundation Code of Conduct or the CONTRIBUTING.md file.

Community

Check out the GitHub repository to ask a question, make a request, or peruse the code!

Building from Source

From the command line clone the git repository, cd into the new directory, and compile with dotnet build.

git clone https://github.com/Finbuckle/Finbuckle.MultiTenant.git
cd Finbuckle.MultiTenant
dotnet build

Running Unit Tests

Run the unit tests from the command line with dotnet test from the solution directory.

dotnet test