Franz.Common.Http.MultiTenancy 1.2.62

dotnet add package Franz.Common.Http.MultiTenancy --version 1.2.62                
NuGet\Install-Package Franz.Common.Http.MultiTenancy -Version 1.2.62                
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="Franz.Common.Http.MultiTenancy" Version="1.2.62" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Franz.Common.Http.MultiTenancy --version 1.2.62                
#r "nuget: Franz.Common.Http.MultiTenancy, 1.2.62"                
#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.
// Install Franz.Common.Http.MultiTenancy as a Cake Addin
#addin nuget:?package=Franz.Common.Http.MultiTenancy&version=1.2.62

// Install Franz.Common.Http.MultiTenancy as a Cake Tool
#tool nuget:?package=Franz.Common.Http.MultiTenancy&version=1.2.62                

Franz.Common.Http.MultiTenancy

A library within the Franz Framework that extends multi-tenancy support for HTTP-based ASP.NET Core applications. This package provides tools for tenant-specific context management, dependency injection, and Swagger documentation enhancements, enabling seamless multi-tenant application development.


Features

  • Tenant Context Management:
    • TenantContextAccessor and DomainContextAccessor for managing tenant-specific information across HTTP requests.
  • Swagger Documentation:
    • AddRequiredHeaderParameter for including tenant-specific headers in Swagger documentation.
  • Dependency Injection:
    • ServiceCollectionExtensions for integrating multi-tenancy into your services and application pipeline.

Version Information

  • Current Version: 1.2.62
  • Part of the private Franz Framework ecosystem.

Dependencies

This package relies on:

  • Microsoft.AspNetCore.Mvc.Core (2.2.5): Core MVC functionality for tenant-based HTTP applications.
  • Swashbuckle.AspNetCore.SwaggerGen (6.5.0): For Swagger generation with multi-tenancy support.
  • Franz.Common.MultiTenancy: Core multi-tenancy utilities and patterns.
  • Franz.Common.Http.Headers: Provides header utilities for tenant-specific HTTP headers.
  • Franz.Common.Http: Core HTTP utilities for multi-tenant scenarios.
  • Franz.Common.Headers: Core header management utilities.

Installation

From Private Azure Feed

Since this package is hosted privately, configure your NuGet client:

dotnet nuget add source "https://your-private-feed-url" \
  --name "AzurePrivateFeed" \
  --username "YourAzureUsername" \
  --password "YourAzurePassword" \
  --store-password-in-clear-text

Install the package:

dotnet add package Franz.Common.Http.MultiTenancy --version 1.2.62

Usage

1. Register Multi-Tenancy Services

Use ServiceCollectionExtensions to register tenant-specific services:

using Franz.Common.Http.MultiTenancy.Extensions;

public class Startup
{
    public void ConfigureServices(IServiceCollection services)
    {
        services.AddMultiTenancy(); // Registers multi-tenancy utilities and services
    }
}

2. Access Tenant Context

Access tenant-specific information using TenantContextAccessor or DomainContextAccessor:

using Franz.Common.Http.MultiTenancy;

public class MyService
{
    private readonly TenantContextAccessor _tenantContextAccessor;

    public MyService(TenantContextAccessor tenantContextAccessor)
    {
        _tenantContextAccessor = tenantContextAccessor;
    }

    public string GetTenantId()
    {
        return _tenantContextAccessor.Tenant?.Id;
    }
}

3. Enhance Swagger Documentation

Use AddRequiredHeaderParameter to include tenant-specific headers in Swagger UI:

using Franz.Common.Http.MultiTenancy.Documentation;

services.AddSwaggerGen(options =>
{
    options.OperationFilter<AddRequiredHeaderParameter>();
});

This ensures tenant headers are explicitly documented in API specifications.


Integration with Franz Framework

The Franz.Common.Http.MultiTenancy package integrates seamlessly with:

  • Franz.Common.MultiTenancy: Provides foundational multi-tenancy utilities.
  • Franz.Common.Http.Headers: Enhances tenant-specific header handling.
  • Franz.Common.Http: Enables tenant-aware HTTP services.
  • Franz.Common.Headers: Provides shared header utilities for HTTP operations.

Ensure these dependencies are installed to fully leverage the library's capabilities.


Contributing

This package is part of a private framework. Contributions are limited to the internal development team. If you have access, follow these steps:

  1. Clone the repository.
  2. Create a feature branch.
  3. Submit a pull request for review.

License

This library is licensed under the MIT License. See the LICENSE file for more details.


Changelog

Version 1.2.62

  • Introduced TenantContextAccessor and DomainContextAccessor for tenant-specific data management.
  • Added AddRequiredHeaderParameter for multi-tenancy support in Swagger.
  • Integrated ServiceCollectionExtensions for streamlined multi-tenancy service registration.
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.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 Franz.Common.Http.MultiTenancy:

Package Downloads
Franz.Common.MongoDB

Shared utility library for the Franz Framework.

Franz.Common.Http.Bootstrap

Shared utility library for the Franz Framework.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.2.62 38 1/8/2025