RelationalConnection.ConnectionBeginTransactionAsync 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 BeginDbTransactionAsync(IsolationLevel, CancellationToken) but can be overridden by providers to make a different call instead.
protected virtual System.Threading.Tasks.ValueTask<System.Data.Common.DbTransaction> ConnectionBeginTransactionAsync (System.Data.IsolationLevel isolationLevel, System.Threading.CancellationToken cancellationToken = default);
abstract member ConnectionBeginTransactionAsync : System.Data.IsolationLevel * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<System.Data.Common.DbTransaction>
override this.ConnectionBeginTransactionAsync : System.Data.IsolationLevel * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<System.Data.Common.DbTransaction>
Protected Overridable Function ConnectionBeginTransactionAsync (isolationLevel As IsolationLevel, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of DbTransaction)
Parameters
- isolationLevel
- IsolationLevel
The isolation level to use for the transaction.
- cancellationToken
- CancellationToken
A CancellationToken to observe while waiting for the task to complete.
Returns
The newly created transaction.
Exceptions
If the CancellationToken is canceled.