Freigeben über


IMigrator.MigrateAsync(String, CancellationToken) Methode

Definition

Migriert die Datenbank entweder zu einer angegebenen Zielmigration oder zur neuesten Migration, die in vorhanden IMigrationsAssemblyist.

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

Parameter

targetMigration
String

Die Zielmigration, zu der die Datenbank migriert werden soll, oder null die zur letzten Migration.

cancellationToken
CancellationToken

Ein CancellationToken , der beobachtet werden soll, während auf den Abschluss der Aufgabe gewartet wird.

Gibt zurück

Eine Aufgabe, die den asynchronen Vorgang darstellt.

Attribute

Ausnahmen

Hinweise

Weitere Informationen und Beispiele finden Sie unter Datenbankmigrationen .

Gilt für: