MixedModeOptions<TKey> class
Namespace: Tenantry.Pro · Package: Tenantry.Pro · API reference
Mixed mode: tenants with different isolation in one application. Set with pro.UseMixedMode(o => o.GetIsolation = ...).
public sealed class MixedModeOptions<TKey> where TKey : IEquatable<TKey>, IParsable<TKey>Type parameters
TKey: The tenant identifier type.
Properties
GetIsolation
Returns where a tenant's data lives. It is called often, so it must be fast, and it must give the same answer for a tenant each time: compute it from the descriptor (its id, or a tier your store sets).
public Func<ITenantDescriptor<TKey>, TenantIsolation>? GetIsolation { get; set; }Value: Func<ITenantDescriptor<TKey>, TenantIsolation>
o.GetIsolation = tenant => tenant.TenantId.StartsWith("enterprise-")
? TenantIsolation.Database
: TenantIsolation.Shared;LicenseRequiredException class
Thrown when no Tenantry.Pro licence key is configured, or the configured key is invalid malformed, a bad signature, or not a Tenantry.Pro licence: when the application starts, and by licence-guarded operations.
PeriodicTenantBackgroundService<TKey> class
Base class for a hosted service that performs work for every tenant on a recurring interval.