IDatabaseCreator.EnsureCreatedAsync(CancellationToken) Metodo

Definizione

Garantisce in modo asincrono che il database per il contesto esista. Se esiste, non viene eseguita alcuna azione. Se non esiste, il database e tutti i relativi schemi vengono creati. Se il database esiste, non viene eseguito alcun tentativo per assicurarsi che sia compatibile con il modello per questo contesto.

public System.Threading.Tasks.Task<bool> EnsureCreatedAsync (System.Threading.CancellationToken cancellationToken = default);
abstract member EnsureCreatedAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<bool>
Public Function EnsureCreatedAsync (Optional cancellationToken As CancellationToken = Nothing) As Task(Of Boolean)

Parametri

cancellationToken
CancellationToken

Oggetto CancellationToken da osservare durante l'attesa del completamento dell'attività.

Restituisce

Attività che rappresenta l'operazione di salvataggio asincrono. Il risultato dell'attività contiene true se il database viene creato, false se esiste già.

Eccezioni

Si applica a