RelationalConnection.ConnectionBeginTransactionAsync 方法

定义

默认情况下调用 BeginDbTransactionAsync(IsolationLevel, CancellationToken) 但可由提供程序替代以进行不同调用的模板方法。

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)

参数

isolationLevel
IsolationLevel

要用于该事务的隔离级别。

cancellationToken
CancellationToken

等待 CancellationToken 任务完成时要观察的 。

返回

新创建的事务。

例外

适用于