Docs
Tenantry ProAPI reference

API reference

View as Markdown

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

Microsoft.Extensions.DependencyInjection

TypeKindSummary
TenantryProBuilderExtensionsclassExtension methods for configuring Tenantry.Pro's features on IProBuilder<TKey>.
TenantryProTenantBuilderExtensionsclassExtension methods for enabling Tenantry.Pro on ITenantBuilder<TKey>.

Tenantry.Pro

TypeKindSummary
ConnectionStringCacheOptionsclassHow tenants' connection strings are cached. Set with pro.CacheConnectionStrings(o => ...).
IProBuilderinterfaceThe builder UsePro passes to its configuration callback, without the tenant key type.
IProBuilder<TKey>interfaceThe builder UsePro passes to its configuration callback.
IProRegistrationinterfaceA 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>interfaceOffboards a tenant, the reverse of ITenantProvisioner<TKey>: runs the deprovisioning steps and reports each one.
ITenantDeprovisioningStep<TKey>interfaceA 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>interfaceProvisions a new tenant: runs every ITenantProvisioningStep<TKey> for it, in order, and reports each step's outcome.
ITenantProvisioningStep<TKey>interfaceA step ITenantProvisioner<TKey> runs to provision a tenant. Add one with IProBuilder<TKey>.AddProvisioningStep<TStep>.
ITenantSeeder<TKey>interfaceWrites a new tenant's initial data, as a step of provisioning (ITenantProvisioner<TKey>).
LicenseRequiredExceptionclassThrown 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>classMixed mode: tenants with different isolation in one application. Set with pro.UseMixedMode(o => o.GetIsolation = ...).
PeriodicTenantBackgroundService<TKey>classBase class for a hosted service that does work for every active tenant at startup, then again every PeriodicTenantBackgroundService<TKey>.Interval.
TenantBackgroundService<TKey>classBase class for a hosted service that does work for every active tenant once, then completes.
TenantDeprovisioningContext<TKey>classWhat a deprovisioning step works with: the tenant being offboarded, a scope of its own, and its isolation.
TenantDeprovisioningResult<TKey>classThe outcome of offboarding a tenant: a result for each deprovisioning step, in the order they ran.
TenantIsolationenumWhere a tenant's data lives, in mixed mode (MixedModeOptions<TKey>.GetIsolation).
TenantLifecycleStepResultclassThe outcome of one step, in TenantProvisioningResult<TKey>.Steps, or of an offboarding step, in TenantDeprovisioningResult<TKey>.Steps.
TenantLifecycleStepStatusenumWhat happened to a provisioning or deprovisioning step.
TenantPropagationBehaviorenumWhat 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.
TenantPropagationOptionsclassWhat 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>classThe tenant an ITenantProvisioningStep<TKey> runs for.
TenantProvisioningOptionsclassHow ITenantProvisioner<TKey> runs the steps. Set with pro.ConfigureProvisioning(o => ...).
TenantProvisioningResult<TKey>classThe 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.

TypeNamespaceKindSummary
ITenantPropagationAdapterTenantry.ProinterfaceA tenant-propagation adapter for a job or messaging library: what the startup check needs to know of it.
ITenantPropagatorTenantry.ProinterfaceCarries the tenant into jobs and messages, with tenant ids as text, so a transport needs no tenant key type.
PropagatedTenantTenantry.ProstructWhat 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).
TenantPropagationAdapterTenantry.ProclassRegisters 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.ProclassA 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

TypeKindSummary
TenantryProEfCoreBuilderExtensionsclassRegisters Tenantry.Pro's EF Core features on IProBuilder<TKey>.
TenantryProHealthChecksBuilderExtensionsclassAdds Tenantry.Pro's tenant health checks to ASP.NET Core's (or any host's) health checks.

Microsoft.Extensions.Hosting

TypeKindSummary
TenantryProEfCoreHostExtensionsclassRuns Tenantry.Pro's tenant migrations as a deployment step.

Tenantry.Pro.EfCore

TypeKindSummary
AuditActionenumThe type of data-modification event captured by an audit entry.
AuditContextclassWho made a save's changes, and what ties them to the request or job that made them, as an IAuditContextProvider gives it.
AuditEntryclassOne entity change an EF Core SaveChanges call saved, recorded by audit logging (pro.AddAuditLogging()).
AuditOptionsclassOptions for the Tenantry.Pro audit-logging feature. Configure via pro.AddAuditLogging(opts => { ... }).
AuditStoreExceptionclassThrown 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.
AuditStoreFailureBehaviorenumWhat happens when IAuditStore fails to write the entries of changes that are already saved, with AuditTiming.AfterCommit. Set with AuditOptions.OnStoreFailure.
AuditTimingenumWhen audit logging passes a save's entries to IAuditStore.
DatabaseDeprovisioningOptions<TContext>classHow offboarding drops each tenant's database. Set with pro.AddDatabaseDeprovisioning<TContext>(o => …).
DatabaseProvisioningOptions<TContext>classHow tenant provisioning creates each tenant's database. Set with pro.AddDatabaseProvisioning<TContext>(o => …).
IAuditContextProviderinterfaceSays 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.
IAuditStoreinterfaceReceives the entries audit logging (pro.AddAuditLogging()) records for the changes a context saves.
ITenantMigrationRunner<TKey>interfaceApplies 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>classThe outcome of a migration run: a result for each database or schema it covered.
MigrationResult<TKey>classThe 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>classWhat 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>classWhich 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>classHow offboarding drops each tenant's schema. Set with pro.AddSchemaDeprovisioning<TContext>(o => …).
SchemaPerTenantOptions<TKey>classSchema 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>classHow tenant provisioning creates each tenant's schema. Set with pro.AddSchemaProvisioning<TContext>(o => …).
StartupMigrationsenumWhether, and how, an application applies a context's migrations when it starts.
TenantHealthCheckOptionsclassHow a tenant health check (AddTenantDatabaseCheck, AddTenantMigrationCheck) checks the tenants' databases. Set with its configure argument.
TenantMigrationOptions<TContext>classHow a context's migrations are applied. Set with pro.AddMigrations<TContext>(o => …).
TenantMigrationRunnerExtensionsclassShorter forms of ITenantMigrationRunner<TKey>'s runs and reads: every tenant, or one.

Tenantry.Pro.Hangfire

Hangfire

TypeKindSummary
TenantryBackgroundJobClientExtensionsclassExtension methods for enqueueing a Hangfire job for a tenant other than the current one.
TenantryHangfireConfigurationExtensionsclassExtension methods for wiring Tenantry.Pro's Hangfire integration into Hangfire's configuration.
TenantryRecurringJobManagerExtensionsclassExtension methods for a recurring Hangfire job that runs for each tenant.

Microsoft.Extensions.DependencyInjection

TypeKindSummary
TenantryProHangfireBuilderExtensionsclassExtension methods for adding the Hangfire integration on IProBuilder<TKey>.

Tenantry.Pro.MassTransit

MassTransit

TypeKindSummary
TenantryMassTransitBusFactoryConfiguratorExtensionsclassExtension methods for wiring Tenantry.Pro's MassTransit integration into a bus.
TenantryMassTransitSendContextExtensionsclassExtension methods for publishing or sending a message for a tenant other than the current one.

Microsoft.Extensions.DependencyInjection

TypeKindSummary
TenantryProMassTransitBuilderExtensionsclassExtension methods for adding the MassTransit integration on IProBuilder<TKey>.

Tenantry.Pro.Quartz

Microsoft.Extensions.DependencyInjection

TypeKindSummary
TenantryProQuartzBuilderExtensionsclassExtension methods for adding the Quartz.NET integration on IProBuilder<TKey>.

Quartz

TypeKindSummary
TenantryQuartzExtensionsclassExtension 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

TypeKindSummary
TenantryProRebusBuilderExtensionsclassExtension methods for adding the Rebus integration on IProBuilder<TKey>.

Rebus.Bus

TypeKindSummary
TenantryRebusHeadersExtensionsclassExtension methods for sending or publishing a message for a tenant other than the current one.

Rebus.Config

TypeKindSummary
TenantryRebusOptionsConfigurerExtensionsclassExtension methods for wiring Tenantry.Pro's Rebus integration into a bus.

On this page