Udostępnij za pośrednictwem


IMigrator.MigrateAsync(String, CancellationToken) Metoda

Definicja

Migruje bazę danych do określonej migracji docelowej lub do najnowszej migracji, która istnieje w obiekcie IMigrationsAssembly.

public System.Threading.Tasks.Task MigrateAsync (string targetMigration = default, System.Threading.CancellationToken cancellationToken = default);
public System.Threading.Tasks.Task MigrateAsync (string? targetMigration = default, System.Threading.CancellationToken cancellationToken = default);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Migration generation currently isn't compatible with trimming")]
public System.Threading.Tasks.Task MigrateAsync (string? targetMigration = default, System.Threading.CancellationToken cancellationToken = default);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Migration generation currently isn't compatible with trimming")]
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Migrations operations are not supported with NativeAOT")]
public System.Threading.Tasks.Task MigrateAsync (string? targetMigration = default, System.Threading.CancellationToken cancellationToken = default);
abstract member MigrateAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Migration generation currently isn't compatible with trimming")>]
abstract member MigrateAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Migration generation currently isn't compatible with trimming")>]
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Migrations operations are not supported with NativeAOT")>]
abstract member MigrateAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function MigrateAsync (Optional targetMigration As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task

Parametry

targetMigration
String

Migracja docelowa do migracji bazy danych do lub null migracji do najnowszej wersji.

cancellationToken
CancellationToken

Element CancellationToken do obserwowania podczas oczekiwania na ukończenie zadania.

Zwraca

Zadanie reprezentujące operację asynchroniczną

Atrybuty

Wyjątki

Jeśli element CancellationToken zostanie anulowany.

Uwagi

Aby uzyskać więcej informacji i przykłady, zobacz Migracje baz danych .

Dotyczy