Class Migrator
Default IMigrator implementation.
Implements
Namespace: Tableau.Migration.Engine.Migrators
Assembly: Tableau.Migration.dll
Syntax
public class Migrator : IMigrator
Constructors
Migrator(IMigrationManifestFactory, IServiceScopeFactory, ILogger<Migrator>, ISharedResourcesLocalizer)
Creates a new Migrator object.
Declaration
public Migrator(IMigrationManifestFactory manifestFactory, IServiceScopeFactory serviceScopeFactory, ILogger<Migrator> log, ISharedResourcesLocalizer localizer)
Parameters
Type | Name | Description |
---|---|---|
IMigrationManifestFactory | manifestFactory | A manifest factory to create empty manifests for on fatal errors. |
IServiceScopeFactory | serviceScopeFactory | The DI scope factory to create migration scopes and dependencies from. |
ILogger<Migrator> | log | A logger to write output to. |
ISharedResourcesLocalizer | localizer | A string localizer. |
Methods
ExecuteAsync(IMigrationPlan, CancellationToken)
Executes a migration asynchronously.
Declaration
public Task<MigrationResult> ExecuteAsync(IMigrationPlan plan, CancellationToken cancel)
Parameters
Type | Name | Description |
---|---|---|
IMigrationPlan | plan | The migration plan to execute. |
CancellationToken | cancel | The cancellation token to obey. |
Returns
Type | Description |
---|---|
Task<MigrationResult> | The results of the migration. |
ExecuteAsync(IMigrationPlan, IMigrationManifest?, CancellationToken)
Executes a migration asynchronously.
Declaration
public Task<MigrationResult> ExecuteAsync(IMigrationPlan plan, IMigrationManifest? previousManifest, CancellationToken cancel)
Parameters
Type | Name | Description |
---|---|---|
IMigrationPlan | plan | The migration plan to execute. |
IMigrationManifest | previousManifest | A manifest from a previous migration of the same plan to use to determine what progress has already been made. |
CancellationToken | cancel | The cancellation token to obey. |
Returns
Type | Description |
---|---|
Task<MigrationResult> | The results of the migration. |