FixedTenantContext
AgentPrism.Core.dllAn immutable tenant context that always returns the same tenant.
public sealed class FixedTenantContext : ITenantContextInheritance
Section titled “Inheritance”Implements
Section titled “Implements”Inherited Members
Section titled “Inherited Members”object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”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.
Constructors
Section titled “Constructors”FixedTenantContext(string)
Section titled “ FixedTenantContext(string)”An immutable tenant context that always returns the same tenant.
public FixedTenantContext(string tenantId)Parameters
Section titled “Parameters”tenantId string
The tenant identifier to return.
Remarks
Section titled “Remarks”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.
Properties
Section titled “Properties”Default
Section titled “ Default”The shared instance that carries the default value of AgentPrismOptions.DefaultTenantId.
public static FixedTenantContext Default { get; }Property Value
Section titled “Property Value”TenantId
Section titled “ TenantId”The current tenant’s identifier. Never returns empty.
public string TenantId { get; }