IRelationalTransactionManager.BeginTransactionAsync 方法

定义

异步启动新事务。

public System.Threading.Tasks.Task<Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction> BeginTransactionAsync (System.Data.IsolationLevel isolationLevel, System.Threading.CancellationToken cancellationToken = default);
abstract member BeginTransactionAsync : System.Data.IsolationLevel * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction>
Public Function BeginTransactionAsync (isolationLevel As IsolationLevel, Optional cancellationToken As CancellationToken = Nothing) As Task(Of IDbContextTransaction)

参数

isolationLevel
IsolationLevel

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

cancellationToken
CancellationToken

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

返回

表示异步操作的任务。 任务结果包含新创建的事务。

例外

适用于