Docs
Tenantry ProAPI reference

MixedModeOptions<TKey> class

Namespace: Tenantry.Pro.Strategies.MixedMode · Package: Tenantry.Pro · API reference

Options for the mixed-mode strategy, which routes individual tenants to either database-per-tenant or schema-per-tenant isolation.

public sealed class MixedModeOptions<TKey> where TKey : IEquatable<TKey>, IParsable<TKey>

Type parameters

  • TKey: The tenant identifier type.

Properties

GetStrategyForTenant

A delegate that returns the isolation strategy for the given tenant descriptor.

public Func<ITenantDescriptor<TKey>, TenantStrategy>? GetStrategyForTenant { get; set; }

Value: Func<ITenantDescriptor<TKey>, TenantStrategy>

opts.GetStrategyForTenant = tenant => tenant.TenantId.StartsWith("enterprise_")
    ? TenantStrategy.Database
    : TenantStrategy.Schema;

On this page