Skip to content
Tracon

TraconTenancyBuilderExtensions

Namespace Tracon · Assembly Tracon.AspNetCore.dll

Extensions that connect multi-tenancy to the HTTP request.

public static class TraconTenancyBuilderExtensions

objectTraconTenancyBuilderExtensions

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

UseTenancy(ITraconBuilder, Action<TraconTenancyOptions>)

Section titled “ UseTenancy(ITraconBuilder, Action<TraconTenancyOptions>)”

Resolves the tenant from the current HTTP request. If not called, Tracon runs single-tenant and no extra configuration is needed.

public static ITraconBuilder UseTenancy(this ITraconBuilder builder, Action<TraconTenancyOptions> configure)

builder ITraconBuilder

The Tracon configuration chain.

configure Action<TraconTenancyOptions>

The resolution settings.

ITraconBuilder

The builder, for chaining.

The claim is preferred as the tenant source; the header path must be opened explicitly and, because it can be spoofed, should only be used inside a trusted network. Details: TraconTenancyOptions.

builder.AddTracon()
.UseOpenAI(apiKey)
.UsePostgreSql(connectionString)
.UseTenancy(options =>
{
options.Enabled = true;
options.ClaimType = "tenant_id";
});

ArgumentNullException

A dependency is null.