Docs
Tenantry ProAPI reference

ITenantMigrator<TKey> interface

Namespace: Tenantry.Pro.Lifecycle · Package: Tenantry.Pro · API reference

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.

public interface ITenantMigrator<TKey> where TKey : IEquatable<TKey>, IParsable<TKey>

Type parameters

  • TKey: The tenant identifier type.

Derived types: MigrationOrchestratorService<TKey, TContext>.

Methods

MigrateAsync(TKey, CancellationToken)

Applies any pending EF Core migrations to the given tenant's database.

Task MigrateAsync(TKey tenantId, CancellationToken cancellationToken = default)

Parameters:

  • tenantId TKey: The tenant whose database should be migrated.
  • cancellationToken CancellationToken: A cancellation token.

Returns: Task

On this page