Method CanConnectAsync
- Namespace
- MongoDB.EntityFrameworkCore.Storage
- Assembly
- MongoDB.EntityFrameworkCore.dll
CanConnectAsync(CancellationToken)
Determines whether or not the database is available and can be connected to.
public Task<bool> CanConnectAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA CancellationToken to observe while waiting for the task to complete.
Returns
Remarks
Note that being able to connect to the database does not mean that it is up-to-date with regard to schema creation, etc.
Exceptions
- OperationCanceledException
If the CancellationToken is canceled.