Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
IDatabaseCreator.EnsureDeletedAsync(CancellationToken) Method
Definition
- Namespace:
- Microsoft.EntityFrameworkCore.Storage
- Assembly:
- Microsoft.EntityFrameworkCore.dll
- Package:
- Microsoft.EntityFrameworkCore v1.0.6
- Package:
- Microsoft.EntityFrameworkCore v1.1.6
- Package:
- Microsoft.EntityFrameworkCore v10.0.0
- Package:
- Microsoft.EntityFrameworkCore v2.0.3
- Package:
- Microsoft.EntityFrameworkCore v2.1.11
- Package:
- Microsoft.EntityFrameworkCore v2.2.6
- Package:
- Microsoft.EntityFrameworkCore v3.0.0
- Package:
- Microsoft.EntityFrameworkCore v3.1.0
- Package:
- Microsoft.EntityFrameworkCore v5.0.0
- Package:
- Microsoft.EntityFrameworkCore v6.0.0
- Package:
- Microsoft.EntityFrameworkCore v7.0.0
- Package:
- Microsoft.EntityFrameworkCore v8.0.0
- Package:
- Microsoft.EntityFrameworkCore v9.0.0
- Source:
- IDatabaseCreator.cs
- Source:
- IDatabaseCreator.cs
- Source:
- IDatabaseCreator.cs
- Source:
- IDatabaseCreator.cs
Important
Some information relates to prerelease product that may be substantially modified before itβs released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
If the CancellationToken is canceled.
Applies to
Entity Framework
Feedback
Was this page helpful?
