Interface ITenantIsolationStrategy
- Namespace
- Compendium.Multitenancy
- Assembly
- Compendium.Multitenancy.dll
Defines a strategy for isolating tenant data in a multi-tenant application. Implementations determine how tenants are separated at the database level.
public interface ITenantIsolationStrategy
Methods
EnsureTenantResourcesAsync(TenantInfo, CancellationToken)
Ensures that the necessary database resources exist for a tenant.
Task<Result> EnsureTenantResourcesAsync(TenantInfo tenant, CancellationToken cancellationToken = default)
Parameters
tenantTenantInfoThe tenant information.
cancellationTokenCancellationTokenThe cancellation token.
Returns
GetConnectionStringAsync(TenantInfo, CancellationToken)
Gets the database connection string for a specific tenant.
Task<Result<string>> GetConnectionStringAsync(TenantInfo tenant, CancellationToken cancellationToken = default)
Parameters
tenantTenantInfoThe tenant information.
cancellationTokenCancellationTokenThe cancellation token.
Returns
GetSchemaNameAsync(TenantInfo, CancellationToken)
Gets the schema name for a specific tenant.
Task<Result<string>> GetSchemaNameAsync(TenantInfo tenant, CancellationToken cancellationToken = default)
Parameters
tenantTenantInfoThe tenant information.
cancellationTokenCancellationTokenThe cancellation token.