Lingua

RelationalDatabaseCreator.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 virtual System.Threading.Tasks.Task<bool> EnsureCreatedAsync(System.Threading.CancellationToken cancellationToken = default);
abstract member EnsureCreatedAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<bool>
override this.EnsureCreatedAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<bool>
Public Overridable 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à.

Valori restituiti

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

Implementazioni

Eccezioni

Se l'oggetto CancellationToken viene annullato.

Si applica a