Sdílet prostřednictvím


IMigrator.MigrateAsync(String, CancellationToken) Metoda

Definice

Migruje databázi na zadanou cílovou migraci nebo až na nejnovější migraci, která existuje v objektu 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

Cílová migrace pro migraci databáze do nebo null pro migraci na nejnovější verzi.

cancellationToken
CancellationToken

A CancellationToken , která se má sledovat při čekání na dokončení úkolu.

Návraty

Úloha, která představuje asynchronní operaci

Atributy

Výjimky

Poznámky

Další informace a příklady najdete v tématu Migrace databází .

Platí pro