Class MigrationEventArgs
Provides data for events that occur during Umbraco database migrations.
Inheritance
Namespace: Umbraco.Cms.Core.Events
Assembly: Umbraco.Infrastructure.dll
Syntax
public class MigrationEventArgs : CancellableObjectEventArgs<IList<Type>>
Constructors
View SourceMigrationEventArgs(IList<Type>, SemVersion, SemVersion, string)
Initializes a new instance of the MigrationEventArgs class.
Declaration
public MigrationEventArgs(IList<Type> migrationTypes, SemVersion configuredVersion, SemVersion targetVersion, string productName)
Parameters
| Type | Name | Description |
|---|---|---|
| IList<Type> | migrationTypes | A list of migration types that are being executed. |
| SemVersion | configuredVersion | The version configured before the migration starts. |
| SemVersion | targetVersion | The version to which the migration is being applied. |
| string | productName | The name of the product undergoing migration. |
MigrationEventArgs(IList<Type>, SemVersion, SemVersion, string, bool)
Initializes a new instance of the MigrationEventArgs class.
Declaration
public MigrationEventArgs(IList<Type> migrationTypes, SemVersion configuredVersion, SemVersion targetVersion, string productName, bool canCancel)
Parameters
| Type | Name | Description |
|---|---|---|
| IList<Type> | migrationTypes | A list of migration types that are part of the migration process. |
| SemVersion | configuredVersion | The version currently configured before migration begins. |
| SemVersion | targetVersion | The version to which the migration will be performed. |
| string | productName | The name of the product undergoing migration. |
| bool | canCancel | True if the migration process can be cancelled; otherwise, false. |
Properties
View SourceConfiguredSemVersion
Gets the origin version of the migration, i.e. the one that is currently installed.
Declaration
public SemVersion ConfiguredSemVersion { get; }
Property Value
| Type | Description |
|---|---|
| SemVersion |
MigrationsTypes
Returns all migrations that were used in the migration runner
Declaration
public IList<Type>? MigrationsTypes { get; }
Property Value
| Type | Description |
|---|---|
| IList<Type> |
ProductName
Gets the product name.
Declaration
public string ProductName { get; }
Property Value
| Type | Description |
|---|---|
| string |
TargetSemVersion
Gets the target version of the migration.
Declaration
public SemVersion TargetSemVersion { get; }
Property Value
| Type | Description |
|---|---|
| SemVersion |
Methods
View SourceEquals(object?)
Determines whether the specified object is equal to the current MigrationEventArgs instance.
Declaration
public override bool Equals(object? obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The object to compare with the current instance. |
Returns
| Type | Description |
|---|---|
| bool |
|
Equals(MigrationEventArgs?)
Determines whether the current MigrationEventArgs instance is equal to another instance of the same type.
Declaration
public bool Equals(MigrationEventArgs? other)
Parameters
| Type | Name | Description |
|---|---|---|
| MigrationEventArgs | other | The MigrationEventArgs to compare with the current instance. |
Returns
| Type | Description |
|---|---|
| bool |
|
Remarks
Equality is determined by comparing the values of ConfiguredSemVersion, MigrationContext, ProductName, and TargetSemVersion.
GetHashCode()
Returns a hash code for this instance, based on its property values.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | A hash code for the current MigrationEventArgs object. |
Operators
View Sourceoperator ==(MigrationEventArgs, MigrationEventArgs)
Declaration
public static bool operator ==(MigrationEventArgs left, MigrationEventArgs right)
Parameters
| Type | Name | Description |
|---|---|---|
| MigrationEventArgs | left | |
| MigrationEventArgs | right |
Returns
| Type | Description |
|---|---|
| bool |
operator !=(MigrationEventArgs, MigrationEventArgs)
Declaration
public static bool operator !=(MigrationEventArgs left, MigrationEventArgs right)
Parameters
| Type | Name | Description |
|---|---|---|
| MigrationEventArgs | left | |
| MigrationEventArgs | right |
Returns
| Type | Description |
|---|---|
| bool |