RelationalConnection.UseTransaction 方法

定义

重载

UseTransaction(DbTransaction, Guid)

指定用于数据库操作的现有 DbTransaction

UseTransaction(DbTransaction)

指定用于数据库操作的现有 DbTransaction

UseTransaction(DbTransaction, Guid)

指定用于数据库操作的现有 DbTransaction

public virtual Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction UseTransaction (System.Data.Common.DbTransaction transaction, Guid transactionId);
public virtual Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction? UseTransaction (System.Data.Common.DbTransaction? transaction, Guid transactionId);
abstract member UseTransaction : System.Data.Common.DbTransaction * Guid -> Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction
override this.UseTransaction : System.Data.Common.DbTransaction * Guid -> Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction
Public Overridable Function UseTransaction (transaction As DbTransaction, transactionId As Guid) As IDbContextTransaction

参数

transaction
DbTransaction

要使用的事务。

transactionId
Guid

事务的唯一标识符。

返回

包装提供的事务的 实例IDbContextTransaction;如果 为 nullnull则为 transaction

实现

适用于

UseTransaction(DbTransaction)

指定用于数据库操作的现有 DbTransaction

public virtual Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction UseTransaction (System.Data.Common.DbTransaction transaction);
public virtual Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction? UseTransaction (System.Data.Common.DbTransaction? transaction);
abstract member UseTransaction : System.Data.Common.DbTransaction -> Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction
override this.UseTransaction : System.Data.Common.DbTransaction -> Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction
Public Overridable Function UseTransaction (transaction As DbTransaction) As IDbContextTransaction

参数

transaction
DbTransaction

要使用的事务。

返回

包装所提供的事务的 实例 IDbTransaction

实现

适用于