ITenantSeeder<TKey> interface
Namespace: Tenantry.Pro · Package: Tenantry.Pro · API reference
Writes a new tenant's initial data, as a step of provisioning (ITenantProvisioner<TKey>). Add one with IProBuilder<TKey>.AddSeeder<TSeeder>: seeders and the steps you add run after Tenantry.Pro's own steps, in the order you add them. A seeder registered only in the service collection is not run.
A seeder is resolved from a new scope for the tenant being provisioned, so it can take scoped services such as a DbContext in its constructor, and they read and write as that tenant.
Make it idempotent: recovering from a failure means provisioning the tenant again, which runs every seeder again, possibly after an earlier attempt wrote some of its rows.
public interface ITenantSeeder<TKey> where TKey : IEquatable<TKey>, IParsable<TKey>Type parameters
TKey: The tenant identifier type.
Methods
SeedAsync(ITenantDescriptor<TKey>, CancellationToken)
Writes the initial data of tenant.
Task SeedAsync(ITenantDescriptor<TKey> tenant, CancellationToken cancellationToken)Parameters:
tenantITenantDescriptor<TKey>: The tenant being provisioned, which is also the current tenant.cancellationTokenCancellationToken: Cancels provisioning.
Returns: Task
ITenantProvisioningStep<TKey> interface
A step ITenantProvisioner<TKey>tenantry-pro-itenantprovisioner.md runs to provision a tenant.
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.