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
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Entity Framework