Skip to content

UtilityExtensions.DoesDatabaseExistAsync.F6QAZBRC8YIDYB8XYKN213GR2

Mike King edited this page Sep 30, 2025 · 2 revisions

UtilityExtensions.DoesDatabaseExistAsync(this DatabaseFacade, CancellationToken) Method

Check if database exists.

public static System.Threading.Tasks.Task<bool> DoesDatabaseExistAsync(this Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade database, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

database Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade

The Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade for the context.

cancellationToken System.Threading.CancellationToken

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

Returns

System.Threading.Tasks.Task<System.Boolean>
A bool indicating if the database exists.

Clone this wiki locally