RelationalConnection.OpenDbConnectionAsync(Boolean, CancellationToken) Method
Definition
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.
Template method that by default calls OpenAsync() but can be overridden by providers to make a different call instead.
protected virtual System.Threading.Tasks.Task OpenDbConnectionAsync (bool errorsExpected, System.Threading.CancellationToken cancellationToken);
abstract member OpenDbConnectionAsync : bool * System.Threading.CancellationToken -> System.Threading.Tasks.Task
override this.OpenDbConnectionAsync : bool * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Protected Overridable Function OpenDbConnectionAsync (errorsExpected As Boolean, cancellationToken As CancellationToken) As Task
Parameters
- errorsExpected
- Boolean
Indicates if the connection errors are expected and should be logged as debug message.
- cancellationToken
- CancellationToken
A CancellationToken to observe while waiting for the task to complete.
Returns
Exceptions
If the CancellationToken is canceled.
Applies to
Entity Framework
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for