RelationalConnection.BeginTransactionAsync 方法

定义

重载

BeginTransactionAsync(CancellationToken)

异步启动新事务。

BeginTransactionAsync(IsolationLevel, CancellationToken)

异步启动新事务。

BeginTransactionAsync(CancellationToken)

异步启动新事务。

public virtual System.Threading.Tasks.Task<Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction> BeginTransactionAsync (System.Threading.CancellationToken cancellationToken = default);
abstract member BeginTransactionAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction>
override this.BeginTransactionAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction>
Public Overridable Function BeginTransactionAsync (Optional cancellationToken As CancellationToken = Nothing) As Task(Of IDbContextTransaction)

参数

cancellationToken
CancellationToken

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

返回

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

实现

例外

适用于

BeginTransactionAsync(IsolationLevel, CancellationToken)

异步启动新事务。

public virtual 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>
override this.BeginTransactionAsync : System.Data.IsolationLevel * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction>
Public Overridable Function BeginTransactionAsync (isolationLevel As IsolationLevel, Optional cancellationToken As CancellationToken = Nothing) As Task(Of IDbContextTransaction)

参数

isolationLevel
IsolationLevel

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

cancellationToken
CancellationToken

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

返回

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

实现

例外

适用于