Skip to content
Tracon

SingleTenantContext

Namespace Tracon · Assembly Tracon.Core.dll

The default tenant context for single-tenant deployments. It always returns TraconOptions.DefaultTenantId.

public sealed class SingleTenantContext : ITenantContext

objectSingleTenantContext

ITenantContext

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

In multi-tenant scenarios, the consumer registers its ITenantContext implementation before calling AddTracon. Tracon uses TryAdd, so the consumer registration wins.

SingleTenantContext(IOptions<TraconOptions>)

Section titled “ SingleTenantContext(IOptions<TraconOptions>)”

Initializes a new single-tenant context.

public SingleTenantContext(IOptions<TraconOptions> options)

options IOptions<TraconOptions>

The Tracon options.

ArgumentNullException

options is null.

The current tenant’s identifier. Never returns empty.

public string TenantId { get; }

string

When AmbientTenantScope.Current is set, for example while a scheduled job runs, its value takes precedence over the default.