Class MigrationBuilder
Facilitates the construction and execution of database migrations.
Inheritance
object
Namespace: Umbraco.Cms.Infrastructure.Migrations
Assembly: Umbraco.Infrastructure.dll
Syntax
public class MigrationBuilder : IMigrationBuilder
Constructors
View SourceMigrationBuilder(IServiceProvider)
Initializes a new instance of the MigrationBuilder class.
Declaration
public MigrationBuilder(IServiceProvider container)
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceProvider | container | The service provider used to resolve migration dependencies. |
Methods
View SourceBuild(Type, IMigrationContext)
Creates and returns an instance of the specified migration type using the provided migration context. The migration type must inherit from AsyncMigrationBase.
Declaration
public AsyncMigrationBase Build(Type migrationType, IMigrationContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | migrationType | The System.Type of the migration to instantiate. |
| IMigrationContext | context | The IMigrationContext to pass to the migration constructor. |
Returns
| Type | Description |
|---|---|
| AsyncMigrationBase | An instance of AsyncMigrationBase created via dependency injection. |