Skip to content
Tracon

ITenantContext

Namespace Tracon · Assembly Tracon.Abstractions.dll

Resolves the current request’s tenant. In a single-tenant setup, returns a fixed value and requires no additional configuration.

public interface ITenantContext

In multi-tenant scenarios, the application binds this interface to its own identity infrastructure: an HTTP header, a claim, or a subdomain.

The current tenant’s identifier. Never returns empty.

string TenantId { get; }

string

The value must be canonical — the form AmbientTenantScope.Normalize returns. The tenant identifier is matched case-insensitively across the product, and every layer achieves that by normalizing the value rather than by comparing case-insensitively. An implementation that returns Acme where another path resolves acme splits one tenant into two on PostgreSQL and SQLite, and merges them on SQL Server’s default collation — the authorization layer and the storage layer then disagree.