Skip to content

AgentPrismTenancyBuilderExtensions

Namespace AgentPrism · Assembly AgentPrism.AspNetCore.dll

Extensions that connect multi-tenancy to the HTTP request.

public static class AgentPrismTenancyBuilderExtensions

objectAgentPrismTenancyBuilderExtensions

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

UseTenancy(IAgentPrismBuilder, Action<AgentPrismTenancyOptions>)

Section titled “ UseTenancy(IAgentPrismBuilder, Action<AgentPrismTenancyOptions>)”

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

public static IAgentPrismBuilder UseTenancy(this IAgentPrismBuilder builder, Action<AgentPrismTenancyOptions> configure)

builder IAgentPrismBuilder

The AgentPrism configuration chain.

configure Action<AgentPrismTenancyOptions>

The resolution settings.

IAgentPrismBuilder

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: AgentPrismTenancyOptions.

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

ArgumentNullException

A dependency is null.