Class MigrationPlanExecutor
Inheritance
Namespace: Umbraco.Cms.Infrastructure.Migrations
Assembly: Umbraco.Infrastructure.dll
Syntax
public class MigrationPlanExecutor : IMigrationPlanExecutor
Constructors
View SourceMigrationPlanExecutor(ICoreScopeProvider, IScopeAccessor, ILoggerFactory, IMigrationBuilder, IUmbracoDatabaseFactory, IDatabaseCacheRebuilder, DistributedCache, IKeyValueService, IServiceScopeFactory, AppCaches)
Declaration
[Obsolete("Please use the constructor taking all parameters. Scheduled for removal in Umbraco 19.")]
public MigrationPlanExecutor(ICoreScopeProvider scopeProvider, IScopeAccessor scopeAccessor, ILoggerFactory loggerFactory, IMigrationBuilder migrationBuilder, IUmbracoDatabaseFactory databaseFactory, IDatabaseCacheRebuilder databaseCacheRebuilder, DistributedCache distributedCache, IKeyValueService keyValueService, IServiceScopeFactory serviceScopeFactory, AppCaches appCaches)
Parameters
| Type | Name | Description |
|---|---|---|
| ICoreScopeProvider | scopeProvider | |
| IScopeAccessor | scopeAccessor | |
| ILoggerFactory | loggerFactory | |
| IMigrationBuilder | migrationBuilder | |
| IUmbracoDatabaseFactory | databaseFactory | |
| IDatabaseCacheRebuilder | databaseCacheRebuilder | |
| DistributedCache | distributedCache | |
| IKeyValueService | keyValueService | |
| IServiceScopeFactory | serviceScopeFactory | |
| AppCaches | appCaches |
MigrationPlanExecutor(ICoreScopeProvider, IScopeAccessor, ILoggerFactory, IMigrationBuilder, IUmbracoDatabaseFactory, IDatabaseCacheRebuilder, DistributedCache, IKeyValueService, IServiceScopeFactory, AppCaches, IPublishedContentTypeFactory)
Declaration
public MigrationPlanExecutor(ICoreScopeProvider scopeProvider, IScopeAccessor scopeAccessor, ILoggerFactory loggerFactory, IMigrationBuilder migrationBuilder, IUmbracoDatabaseFactory databaseFactory, IDatabaseCacheRebuilder databaseCacheRebuilder, DistributedCache distributedCache, IKeyValueService keyValueService, IServiceScopeFactory serviceScopeFactory, AppCaches appCaches, IPublishedContentTypeFactory publishedContentTypeFactory)
Parameters
| Type | Name | Description |
|---|---|---|
| ICoreScopeProvider | scopeProvider | |
| IScopeAccessor | scopeAccessor | |
| ILoggerFactory | loggerFactory | |
| IMigrationBuilder | migrationBuilder | |
| IUmbracoDatabaseFactory | databaseFactory | |
| IDatabaseCacheRebuilder | databaseCacheRebuilder | |
| DistributedCache | distributedCache | |
| IKeyValueService | keyValueService | |
| IServiceScopeFactory | serviceScopeFactory | |
| AppCaches | appCaches | |
| IPublishedContentTypeFactory | publishedContentTypeFactory |
Methods
View SourceExecutePlan(MigrationPlan, string)
Executes the migration plan.
Declaration
[Obsolete("Use ExecutePlanAsync instead. Scheduled for removal in Umbraco 18.")]
public ExecutedMigrationPlan ExecutePlan(MigrationPlan plan, string fromState)
Parameters
| Type | Name | Description |
|---|---|---|
| MigrationPlan | plan | The migration plan to execute. |
| string | fromState | The state to start execution at. |
Returns
| Type | Description |
|---|---|
| ExecutedMigrationPlan | ExecutedMigrationPlan containing information about the plan execution, such as completion state and the steps that ran. |
Remarks
Each migration in the plan, may or may not run in a scope depending on the type of plan.
A plan can complete partially, the changes of each completed migration will be saved.
ExecutePlanAsync(MigrationPlan, string)
Executes the migration plan asynchronously.
Declaration
public Task<ExecutedMigrationPlan> ExecutePlanAsync(MigrationPlan plan, string fromState)
Parameters
| Type | Name | Description |
|---|---|---|
| MigrationPlan | plan | The migration plan to execute. |
| string | fromState | The state to start execution at. |
Returns
| Type | Description |
|---|---|
| Task<ExecutedMigrationPlan> | A Task of ExecutedMigrationPlan containing information about the plan execution, such as completion state and the steps that ran. |
Remarks
Each migration in the plan, may or may not run in a scope depending on the type of plan.
A plan can complete partially, the changes of each completed migration will be saved.