Tenantry ProAPI reference
API reference
View as MarkdownEvery 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
Microsoft.Extensions.DependencyInjection
| Type | Kind | Summary |
|---|---|---|
TenantryProBuilderExtensions | class | Extension methods for configuring Tenantry.Pro's features on IProBuilder<TKey>. |
TenantryProTenantBuilderExtensions | class | Extension methods for enabling Tenantry.Pro on ITenantBuilder<TKey>. |
Tenantry.Pro
| Type | Kind | Summary |
|---|---|---|
ConnectionStringCacheOptions | class | How tenants' connection strings are cached. Set with pro.CacheConnectionStrings(o => ...). |
IProBuilder | interface | The builder UsePro passes to its configuration callback, without the tenant key type. |
IProBuilder<TKey> | interface | The builder UsePro passes to its configuration callback. |
IProRegistration | interface | A registration that needs the tenant key type, added through IProBuilder.Add. Packages use it for builder methods that take a type parameter of their own, such as a DbContext type. |
ITenantDeprovisioner<TKey> | interface | Offboards a tenant, the reverse of ITenantProvisioner<TKey>: runs the deprovisioning steps and reports each one. |
ITenantDeprovisioningStep<TKey> | interface | A step of offboarding a tenant (ITenantDeprovisioner<TKey>): export its data, archive it, tell another system. Add one with IProBuilder<TKey>.AddDeprovisioningStep<TStep>; the application's steps run before Tenantry drops anything. |
ITenantProvisioner<TKey> | interface | Provisions a new tenant: runs every ITenantProvisioningStep<TKey> for it, in order, and reports each step's outcome. |
ITenantProvisioningStep<TKey> | interface | A step ITenantProvisioner<TKey> runs to provision a tenant. Add one with IProBuilder<TKey>.AddProvisioningStep<TStep>. |
ITenantSeeder<TKey> | interface | Writes a new tenant's initial data, as a step of provisioning (ITenantProvisioner<TKey>). |
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. |
MixedModeOptions<TKey> | class | Mixed mode: tenants with different isolation in one application. Set with pro.UseMixedMode(o => o.GetIsolation = ...). |
PeriodicTenantBackgroundService<TKey> | class | Base class for a hosted service that does work for every active tenant at startup, then again every PeriodicTenantBackgroundService<TKey>.Interval. |
TenantBackgroundService<TKey> | class | Base class for a hosted service that does work for every active tenant once, then completes. |
TenantDeprovisioningContext<TKey> | class | What a deprovisioning step works with: the tenant being offboarded, a scope of its own, and its isolation. |
TenantDeprovisioningResult<TKey> | class | The outcome of offboarding a tenant: a result for each deprovisioning step, in the order they ran. |
TenantIsolation | enum | Where a tenant's data lives, in mixed mode (MixedModeOptions<TKey>.GetIsolation). |
TenantLifecycleStepResult | class | The outcome of one step, in TenantProvisioningResult<TKey>.Steps, or of an offboarding step, in TenantDeprovisioningResult<TKey>.Steps. |
TenantLifecycleStepStatus | enum | What happened to a provisioning or deprovisioning step. |
TenantPropagationBehavior | enum | What a tenant-propagation integration (Hangfire, MassTransit, Quartz.NET, Rebus) does with a job or message whose tenant it cannot make current. Set with TenantPropagationOptions.OnMissingTenant and TenantPropagationOptions.OnUnresolvedTenant. |
TenantPropagationOptions | class | What a tenant-propagation integration (Hangfire, MassTransit, Quartz.NET, Rebus) does with a job or message that carries no tenant, or a tenant it cannot find. Set for each integration when it is added, as in pro.AddRebusPropagation(o => o.OnMissingTenant = TenantPropagationBehavior.Reject). |
TenantProvisioningContext<TKey> | class | The tenant an ITenantProvisioningStep<TKey> runs for. |
TenantProvisioningOptions | class | How ITenantProvisioner<TKey> runs the steps. Set with pro.ConfigureProvisioning(o => ...). |
TenantProvisioningResult<TKey> | class | The outcome of ITenantProvisioner<TKey>.ProvisionAsync. |
Extension points
For code that extends the package, such as another package that builds on it. An application rarely needs them.
| Type | Namespace | Kind | Summary |
|---|---|---|---|
ITenantPropagationAdapter | Tenantry.Pro | interface | A tenant-propagation adapter for a job or messaging library: what the startup check needs to know of it. |
ITenantPropagator | Tenantry.Pro | interface | Carries the tenant into jobs and messages, with tenant ids as text, so a transport needs no tenant key type. |
PropagatedTenant | Tenantry.Pro | struct | What ITenantPropagator resolved for a job or message: a tenant to run as (PropagatedTenant.Resolved), no tenant (PropagatedTenant.WithoutTenant), or that the work must not run (PropagatedTenant.Skipped). |
TenantPropagationAdapter | Tenantry.Pro | class | Registers a tenant-propagation adapter (ITenantPropagationAdapter) for its pro.Add…Propagation() method, as Tenantry.Pro's Hangfire, MassTransit, Quartz.NET and Rebus integrations do, and formats the tenant ids its WithTenant methods take. |
TenantPropagationIntegration<TAdapter> | Tenantry.Pro | class | A tenant-propagation adapter as TenantPropagationAdapter.Add<TKey, TAdapter> registered it: its options, the propagator, and how many times its host side has run. |
Tenantry.Pro.EfCore
Microsoft.Extensions.DependencyInjection
| Type | Kind | Summary |
|---|---|---|
TenantryProEfCoreBuilderExtensions | class | Registers Tenantry.Pro's EF Core features on IProBuilder<TKey>. |
TenantryProHealthChecksBuilderExtensions | class | Adds Tenantry.Pro's tenant health checks to ASP.NET Core's (or any host's) health checks. |
Microsoft.Extensions.Hosting
| Type | Kind | Summary |
|---|---|---|
TenantryProEfCoreHostExtensions | class | Runs Tenantry.Pro's tenant migrations as a deployment step. |
Tenantry.Pro.EfCore
| Type | Kind | Summary |
|---|---|---|
AuditAction | enum | The type of data-modification event captured by an audit entry. |
AuditContext | class | Who made a save's changes, and what ties them to the request or job that made them, as an IAuditContextProvider gives it. |
AuditEntry | class | One entity change an EF Core SaveChanges call saved, recorded by audit logging (pro.AddAuditLogging()). |
AuditOptions | class | Options for the Tenantry.Pro audit-logging feature. Configure via pro.AddAuditLogging(opts => { ... }). |
AuditStoreException | class | Thrown from SaveChanges, or from a transaction's commit, when IAuditStore failed to write the entries of changes that were saved, with AuditOptions.OnStoreFailure set to AuditStoreFailureBehavior.Throw. |
AuditStoreFailureBehavior | enum | What happens when IAuditStore fails to write the entries of changes that are already saved, with AuditTiming.AfterCommit. Set with AuditOptions.OnStoreFailure. |
AuditTiming | enum | When audit logging passes a save's entries to IAuditStore. |
DatabaseDeprovisioningOptions<TContext> | class | How offboarding drops each tenant's database. Set with pro.AddDatabaseDeprovisioning<TContext>(o => …). |
DatabaseProvisioningOptions<TContext> | class | How tenant provisioning creates each tenant's database. Set with pro.AddDatabaseProvisioning<TContext>(o => …). |
IAuditContextProvider | interface | Says who made the changes a save records, and what ties them to the request or job that made them: the AuditEntry.Actor, AuditEntry.CorrelationId and AuditEntry.Data of each entry. |
IAuditStore | interface | Receives the entries audit logging (pro.AddAuditLogging()) records for the changes a context saves. |
ITenantMigrationRunner<TKey> | interface | Applies the migrations of every context added with pro.AddMigrations<TContext>(), for every tenant, and reads which are applied. Registered by AddMigrations, as a singleton. |
MigrationReport<TKey> | class | The outcome of a migration run: a result for each database or schema it covered. |
MigrationResult<TKey> | class | The outcome of applying a context's migrations to one database or schema: the one the context connects to for the tenants in MigrationResult<TKey>.TenantIds. |
MigrationRunOptions<TKey> | class | What a migration run covers and when it stops early: the tenants to migrate or leave out, and how many failures to allow. Pass it to ITenantMigrationRunner<TKey>.MigrateAsync; migrate-tenants builds it from --tenant, --exclude and --max-failures. |
MigrationStatusEntry<TKey> | class | Which of a context's migrations a database or schema has applied, and which are pending: the database or schema the context connects to for the tenants in MigrationStatusEntry<TKey>.TenantIds. |
SchemaDeprovisioningOptions<TContext> | class | How offboarding drops each tenant's schema. Set with pro.AddSchemaDeprovisioning<TContext>(o => …). |
SchemaPerTenantOptions<TKey> | class | Schema per tenant: each tenant's tables in a schema of its own, in a shared database. Set with pro.UseSchemaPerTenant(o => o.GetSchemaName = …). |
SchemaProvisioningOptions<TContext> | class | How tenant provisioning creates each tenant's schema. Set with pro.AddSchemaProvisioning<TContext>(o => …). |
StartupMigrations | enum | Whether, and how, an application applies a context's migrations when it starts. |
TenantHealthCheckOptions | class | How a tenant health check (AddTenantDatabaseCheck, AddTenantMigrationCheck) checks the tenants' databases. Set with its configure argument. |
TenantMigrationOptions<TContext> | class | How a context's migrations are applied. Set with pro.AddMigrations<TContext>(o => …). |
TenantMigrationRunnerExtensions | class | Shorter forms of ITenantMigrationRunner<TKey>'s runs and reads: every tenant, or one. |
Tenantry.Pro.Hangfire
Hangfire
| Type | Kind | Summary |
|---|---|---|
TenantryBackgroundJobClientExtensions | class | Extension methods for enqueueing a Hangfire job for a tenant other than the current one. |
TenantryHangfireConfigurationExtensions | class | Extension methods for wiring Tenantry.Pro's Hangfire integration into Hangfire's configuration. |
TenantryRecurringJobManagerExtensions | class | Extension methods for a recurring Hangfire job that runs for each tenant. |
Microsoft.Extensions.DependencyInjection
| Type | Kind | Summary |
|---|---|---|
TenantryProHangfireBuilderExtensions | class | Extension methods for adding the Hangfire integration on IProBuilder<TKey>. |
Tenantry.Pro.MassTransit
MassTransit
| Type | Kind | Summary |
|---|---|---|
TenantryMassTransitBusFactoryConfiguratorExtensions | class | Extension methods for wiring Tenantry.Pro's MassTransit integration into a bus. |
TenantryMassTransitSendContextExtensions | class | Extension methods for publishing or sending a message for a tenant other than the current one. |
Microsoft.Extensions.DependencyInjection
| Type | Kind | Summary |
|---|---|---|
TenantryProMassTransitBuilderExtensions | class | Extension methods for adding the MassTransit integration on IProBuilder<TKey>. |
Tenantry.Pro.Quartz
Microsoft.Extensions.DependencyInjection
| Type | Kind | Summary |
|---|---|---|
TenantryProQuartzBuilderExtensions | class | Extension methods for adding the Quartz.NET integration on IProBuilder<TKey>. |
Quartz
| Type | Kind | Summary |
|---|---|---|
TenantryQuartzExtensions | class | Extension methods for wiring Tenantry.Pro's Quartz.NET integration into Quartz, and for scheduling a job for a tenant. |
Tenantry.Pro.Rebus
Microsoft.Extensions.DependencyInjection
| Type | Kind | Summary |
|---|---|---|
TenantryProRebusBuilderExtensions | class | Extension methods for adding the Rebus integration on IProBuilder<TKey>. |
Rebus.Bus
| Type | Kind | Summary |
|---|---|---|
TenantryRebusHeadersExtensions | class | Extension methods for sending or publishing a message for a tenant other than the current one. |
Rebus.Config
| Type | Kind | Summary |
|---|---|---|
TenantryRebusOptionsConfigurerExtensions | class | Extension methods for wiring Tenantry.Pro's Rebus integration into a bus. |