IDatabaseCreator.EnsureDeletedAsync(CancellationToken) Method

Definition

Asynchronously ensures that the database for the context does not exist. If it does not exist, no action is taken. If it does exist then the database is deleted.

Warning: The entire database is deleted an no effort is made to remove just the database objects that are used by the model for this context.

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

Parameters

cancellationToken
CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Returns

A task that represents the asynchronous save operation. The task result contains true if the database is deleted, false if it did not exist.

Exceptions

Applies to