Tenantry ProAPI reference
API reference
Every public type in the packages, generated from their XML documentation comments. The guides explain how the pieces fit together; this reference is for the details of each type and member.
Tenantry.Pro
Tenantry.Pro
| Type | Kind | Summary |
|---|---|---|
ProServiceCollectionExtensions | class | Extension methods for enabling Tenantry.Pro features on ITenantBuilder<TKey>. |
Tenantry.Pro.BackgroundServices
| Type | Kind | Summary |
|---|---|---|
PeriodicTenantBackgroundService<TKey> | class | Base class for a hosted service that performs work for every tenant on a recurring interval. The first sweep runs at startup, then again every PeriodicTenantBackgroundService<TKey>.Interval. Each tenant is processed inside its own scope with per-tenant failure isolation (see TenantBackgroundService<TKey>); a failure in one sweep does not stop later sweeps. |
TenantBackgroundService<TKey> | class | Base class for a hosted service that performs work for every tenant once, then completes. |
TenantContextPropagation | class | Shared tenant-resolution logic for the Tenantry.Pro background-job and messaging integrations. Parses a tenant identifier carried by a job/message, looks it up in the store, and applies the configured MissingTenantBehavior when no tenant can be resolved. |
TenantPropagationDecision<TKey> | struct | The outcome of resolving the tenant for a single job or message. |
TenantPropagationOptions | class | Configures how a tenant-context propagation integration (Hangfire, MassTransit, Quartz, Rebus) behaves when a job or message has no resolvable tenant — because none was attached, the attached value could not be parsed as TKey, or the tenant was not found in the store. |
TenantPropagationOutcome | enum | The action a tenant-propagation integration should take for a single job or message, as decided by TenantContextPropagation. |
Tenantry.Pro.Exceptions
| Type | Kind | Summary |
|---|---|---|
LicenseRequiredException | class | Thrown when no Tenantry.Pro licence key is configured, or the configured key is invalid (malformed, a bad signature or the wrong issuer): when the application starts, and by licence-guarded operations. |
Tenantry.Pro.Internal
| Type | Kind | Summary |
|---|---|---|
ProBuilder<TKey> | class | Fluent builder for configuring Tenantry.Pro features. Obtained via tenant.UsePro(pro => { ... }) inside AddTenantry. |
Tenantry.Pro.Licensing
| Type | Kind | Summary |
|---|---|---|
ILicenseGuard | interface | Checks that a valid Tenantry.Pro licence is configured. A public seam so that public, provider-agnostic services (such as the EF Core provisioning services) can take the licence check in a public constructor, while the validator itself stays internal. |
LicenseOptions | class | Options for configuring the Tenantry.Pro licence. |
Tenantry.Pro.Lifecycle
| Type | Kind | Summary |
|---|---|---|
ITenantInfrastructureProvisioner<TKey> | interface | Provisions the infrastructure (database or schema) for a new tenant. Implemented by database-provider packages (Tenantry.Pro.EfCore.SqlServer, Tenantry.Pro.EfCore.Npgsql, etc.) and consumed by ITenantLifecycleManager<TKey> to run the provisioning step without depending on any specific provider or strategy. |
ITenantLifecycleManager<TKey> | interface | Orchestrates the full tenant creation lifecycle: provision → migrate → seed. |
ITenantMigrator<TKey> | interface | Runs EF Core migrations for a single tenant's database. Implemented by Tenantry.Pro.Migrations and consumed by ITenantLifecycleManager<TKey> without exposing the TContext type parameter. The EF Core implementation is registered by WithMigrationOrchestration, which carries the trimming and Native AOT warnings, so this interface and the lifecycle pipeline do not. |
ITenantSeeder<TKey> | interface | Consumer-implemented interface for seeding initial data into a new tenant's database. Register an implementation in DI before calling ITenantLifecycleManager<TKey>.ProvisionAsync: csharp services.AddScoped<ITenantSeeder<Guid>, MyTenantSeeder>(); |
TenantLifecycleOptions | class | Options for ITenantLifecycleManager<TKey> behaviour. Configure via pro.AddLifecycleManagement(opts => { ... }). |
TenantProvisioningResult<TKey> | class | Describes the outcome of a ITenantLifecycleManager<TKey>.ProvisionAsync call. |
TenantProvisioningStep | enum | Represents the pipeline stages in the tenant provisioning lifecycle. Used by TenantProvisioningResult<TKey>.CompletedUpTo to indicate which stage completed successfully before a failure occurred (or before the pipeline finished). |
Tenantry.Pro.Lifecycle.Extensions
| Type | Kind | Summary |
|---|---|---|
LifecycleProBuilderExtensions | class | Extension methods for registering tenant lifecycle management on ProBuilder<TKey>. |
Tenantry.Pro.Strategies.DatabasePerTenant
| Type | Kind | Summary |
|---|---|---|
ConnectionStringEncryptionMode | enum | Determines how connection strings are encrypted before being stored in the cache. |
ConnectionStringEncryptionOptions | class | Configures at-rest encryption for cached connection strings. Set via opts.Encryption.Mode = ... inside pro.UseDatabasePerTenant(...). |
DatabasePerTenantOptions<TKey> | class | Options for the database-per-tenant strategy. Configure via pro.UseDatabasePerTenant(opts => { ... }). |
IConnectionStringCache<TKey> | interface | Allows invalidating cached connection strings for a specific tenant. |
IConnectionStringProtector | interface | Encrypts and decrypts connection strings for at-rest protection in the connection string cache. Implement this interface and register it in DI when using ConnectionStringEncryptionMode.Custom. |
Tenantry.Pro.Strategies.MixedMode
| Type | Kind | Summary |
|---|---|---|
MixedModeOptions<TKey> | class | Options for the mixed-mode strategy, which routes individual tenants to either database-per-tenant or schema-per-tenant isolation. |
MixedStrategyResolver<TKey> | class | Resolves the connection string or schema name for the tenant currently in scope, delegating to the appropriate underlying resolver based on the tenant's assigned strategy. |
TenantStrategy | enum | Specifies which isolation strategy a tenant uses in mixed-mode deployments. |
Tenantry.Pro.Strategies.SchemaPerTenant
| Type | Kind | Summary |
|---|---|---|
ISchemaNameResolver<TKey> | interface | Resolves the SQL schema name for the tenant currently in scope. Inject this into your DbContext.OnModelCreating override to set the default schema for the current tenant's model. |
SchemaPerTenantOptions<TKey> | class | Options for the schema-per-tenant strategy. Configure via pro.UseSchemaPerTenant(opts => { ... }). |
Tenantry.Pro.Telemetry
| Type | Kind | Summary |
|---|---|---|
TenantryMeter | class | Central meter for all Tenantry.Pro tenant-scoped metrics. |
Tenantry.Pro.AspNetCore
Tenantry.Pro.AspNetCore
| Type | Kind | Summary |
|---|---|---|
DataProtectionEncryptionExtensions | class | Extension methods for enabling ASP.NET Core Data Protection encryption for cached connection strings. |
Tenantry.Pro.AspNetCore.Telemetry
| Type | Kind | Summary |
|---|---|---|
TenantMetricsOptions | class | Options for tenant request metrics collection. Configure via pro.AddTenantMetrics(opts => { ... }). |
Tenantry.Pro.AspNetCore.Telemetry.Extensions
| Type | Kind | Summary |
|---|---|---|
ApplicationBuilderTelemetryExtensions | class | Extension methods for wiring tenant metrics middleware into the ASP.NET Core pipeline. |
TelemetryProBuilderExtensions | class | Extension methods for registering tenant metrics on ProBuilder<TKey>. |
Tenantry.Pro.EfCore
Tenantry.Pro.EfCore
| Type | Kind | Summary |
|---|---|---|
ProBuilderEfCoreExtensions | class | Extension methods for ProBuilder<TKey> that wire up EF Core services. |
Tenantry.Pro.EfCore.Audit
| Type | Kind | Summary |
|---|---|---|
AuditAction | enum | The type of data-modification event captured by an audit entry. |
AuditEntry | class | Represents a single audited entity change captured before an EF Core SaveChanges call. |
AuditOptions | class | Options for the Tenantry.Pro audit-logging feature. Configure via pro.AddAuditLogging(opts => { ... }). |
IAuditStore | interface | Receives audit entries produced by Tenantry.Pro.EfCore.Audit after each successful EF Core SaveChanges call. |
Tenantry.Pro.EfCore.Audit.Extensions
| Type | Kind | Summary |
|---|---|---|
AuditProBuilderExtensions | class | Extension methods for registering audit-logging services on ProBuilder<TKey>. |
DbContextOptionsBuilderAuditExtensions | class | Extension methods for wiring Tenantry.Pro.EfCore.Audit into an EF Core DbContext. |
Tenantry.Pro.EfCore.Extensions
| Type | Kind | Summary |
|---|---|---|
DbContextOptionsBuilderExtensions | class | Extension methods for wiring Tenantry.Pro schema-per-tenant services into DbContextOptionsBuilder. |
Tenantry.Pro.EfCore.Migrations
| Type | Kind | Summary |
|---|---|---|
MigrationOrchestratorService<TKey, TContext> | class | Runs pending EF Core migrations across all tenant databases discovered via ITenantStore<TKey>. |
MigrationReport<TKey> | class | The aggregate outcome of running EF Core migrations across all tenant databases. |
MigrationResult<TKey> | class | The outcome of running EF Core migrations against a single tenant's database. |
MigrationStatusEntry<TKey> | class | A point-in-time snapshot of which EF Core migrations have been applied to a specific tenant's database. |
MigrationStatusTracker<TKey, TContext> | class | Queries the applied and pending EF Core migrations for each tenant's database. |
Tenantry.Pro.EfCore.Strategies.DatabasePerTenant
| Type | Kind | Summary |
|---|---|---|
DatabaseProvisioningServiceBase<TKey> | class | Provider-agnostic base for database-per-tenant provisioning. |
Tenantry.Pro.EfCore.Strategies.SchemaPerTenant
| Type | Kind | Summary |
|---|---|---|
SchemaProvisioningOptions | class | Options for schema-per-tenant provisioning. Configure via pro.AddSchemaProvisioning(opts => opts.ConnectionString = ...). |
SchemaProvisioningServiceBase<TKey> | class | Provider-agnostic base for schema-per-tenant provisioning. Implements the shared pipeline (licence guard, schema-name resolution, tenant lookup, connection-string guard, logging) as a template method and defers the ADO.NET-specific CREATE SCHEMA to the provider subclass. |
TenantModelCacheKeyFactory<TKey> | class | EF Core IModelCacheKeyFactory that includes the current tenant ID in the cache key. |
Tenantry.Pro.EfCore.MySql
Tenantry.Pro.EfCore.MySql.Extensions
| Type | Kind | Summary |
|---|---|---|
MySqlProBuilderExtensions | class | Extension methods for registering MySQL/MariaDB-backed Tenantry.Pro services on ProBuilder<TKey>. |
Tenantry.Pro.EfCore.MySql.Strategies.DatabasePerTenant
| Type | Kind | Summary |
|---|---|---|
DatabaseProvisioningService<TKey> | class | Creates a dedicated MySQL or MariaDB database for a tenant when called explicitly. |
Tenantry.Pro.EfCore.Npgsql
Tenantry.Pro.EfCore.Npgsql.Extensions
| Type | Kind | Summary |
|---|---|---|
PostgreSqlProBuilderExtensions | class | Extension methods for registering PostgreSQL-backed Tenantry.Pro services on ProBuilder<TKey>. |
Tenantry.Pro.EfCore.Npgsql.Strategies.DatabasePerTenant
| Type | Kind | Summary |
|---|---|---|
DatabaseProvisioningService<TKey> | class | Creates a dedicated PostgreSQL database for a tenant when called explicitly. |
Tenantry.Pro.EfCore.Npgsql.Strategies.SchemaPerTenant
| Type | Kind | Summary |
|---|---|---|
SchemaProvisioningService<TKey> | class | Creates a dedicated PostgreSQL schema for a tenant when called explicitly. |
Tenantry.Pro.EfCore.SqlServer
Tenantry.Pro.EfCore.SqlServer.Extensions
| Type | Kind | Summary |
|---|---|---|
SqlServerProBuilderExtensions | class | Extension methods for registering SQL Server-backed Tenantry.Pro services on ProBuilder<TKey>. |
Tenantry.Pro.EfCore.SqlServer.Strategies.DatabasePerTenant
| Type | Kind | Summary |
|---|---|---|
DatabaseProvisioningService<TKey> | class | Creates a dedicated SQL Server database for a tenant when called explicitly. |
Tenantry.Pro.EfCore.SqlServer.Strategies.SchemaPerTenant
| Type | Kind | Summary |
|---|---|---|
SchemaProvisioningService<TKey> | class | Creates a dedicated SQL Server schema for a tenant when called explicitly. |
Tenantry.Pro.Hangfire
Tenantry.Pro.Hangfire.Extensions
| Type | Kind | Summary |
|---|---|---|
ApplicationBuilderHangfireExtensions | class | Extension methods for wiring Tenantry.Pro's Hangfire integration into the ASP.NET Core application pipeline. |
HangfireProBuilderExtensions | class | Extension methods for registering Hangfire tenant-propagation services on ProBuilder<TKey>. |
Tenantry.Pro.Hangfire.Filters
| Type | Kind | Summary |
|---|---|---|
TenantJobFilter<TKey> | class | Hangfire filter that propagates the current tenant context into background jobs. |
Tenantry.Pro.HealthChecks
Tenantry.Pro.HealthChecks
| Type | Kind | Summary |
|---|---|---|
TenantHealthCheckOptions | class | Options for tenant database health checks. Configure via builder.Services.AddHealthChecks().AddTenantryDatabaseCheck<TKey>(opts => { ... }). |
Tenantry.Pro.HealthChecks.Extensions
| Type | Kind | Summary |
|---|---|---|
HealthCheckBuilderExtensions | class | Extension methods for adding Tenantry.Pro health checks to the ASP.NET Core health check pipeline. |
Tenantry.Pro.MassTransit
Tenantry.Pro.MassTransit.Extensions
| Type | Kind | Summary |
|---|---|---|
BusFactoryConfiguratorExtensions | class | Extension methods for wiring Tenantry.Pro's publish and send filters into the MassTransit bus pipeline. |
BusRegistrationConfiguratorExtensions | class | Extension methods for adding Tenantry.Pro's consume-side tenant filter to all MassTransit receive endpoints. |
MassTransitProBuilderExtensions | class | Extension methods for registering MassTransit tenant-propagation services on ProBuilder<TKey>. |
Tenantry.Pro.MassTransit.Filters
| Type | Kind | Summary |
|---|---|---|
TenantConsumeFilter<TKey> | class | MassTransit pipeline filter that restores the tenant scope when a message is consumed. |
TenantPublishFilter<TKey> | class | MassTransit pipeline filter that adds the current tenant ID as a message header when a message is published. |
TenantSendFilter<TKey> | class | MassTransit pipeline filter that adds the current tenant ID as a message header when a message is sent point-to-point. |
Tenantry.Pro.Quartz
Tenantry.Pro.Quartz
| Type | Kind | Summary |
|---|---|---|
TenantJobData | class | Well-known keys used to carry tenant context through Quartz job data maps. |
Tenantry.Pro.Quartz.Extensions
| Type | Kind | Summary |
|---|---|---|
JobDataMapExtensions | class | Extension methods for JobDataMap to support tenant propagation. |
QuartzProBuilderExtensions | class | Extension methods for registering Quartz tenant-propagation services on ProBuilder<TKey>. |
Tenantry.Pro.Rebus
Tenantry.Pro.Rebus.Extensions
| Type | Kind | Summary |
|---|---|---|
RebusConfigurationExtensions | class | Extension methods for wiring Tenantry tenant steps into the Rebus pipeline. |
RebusProBuilderExtensions | class | Extension methods for registering Rebus tenant-propagation services on ProBuilder<TKey>. |
Tenantry.Pro.Rebus.Steps
| Type | Kind | Summary |
|---|---|---|
TenantIncomingStep<TKey> | class | Rebus incoming pipeline step that restores the tenant scope from a message header. |
TenantOutgoingStep<TKey> | class | Rebus outgoing pipeline step that stamps the current tenant ID as a message header. |