Skip to content

FixedTenantContext

Namespace AgentPrism · Assembly AgentPrism.Core.dll

An immutable tenant context that always returns the same tenant.

public sealed class FixedTenantContext : ITenantContext

objectFixedTenantContext

ITenantContext

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

In-memory stores read the tenant through ITenantContext. When a store is created outside DI directly with new, this type supplies the context if one is not provided, and the store behaves as single tenant.

Making a store tenant context optional does not make filtering optional. A context always exists. Its value is simply fixed when it is not supplied. Filtering occurs in every code path.

An immutable tenant context that always returns the same tenant.

public FixedTenantContext(string tenantId)

tenantId string

The tenant identifier to return.

In-memory stores read the tenant through ITenantContext. When a store is created outside DI directly with new, this type supplies the context if one is not provided, and the store behaves as single tenant.

Making a store tenant context optional does not make filtering optional. A context always exists. Its value is simply fixed when it is not supplied. Filtering occurs in every code path.

The shared instance that carries the default value of AgentPrismOptions.DefaultTenantId.

public static FixedTenantContext Default { get; }

FixedTenantContext

The current tenant’s identifier. Never returns empty.

public string TenantId { get; }

string