RelationalConnection.UseTransaction 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
UseTransaction(DbTransaction, Guid) |
指定用于数据库操作的现有 DbTransaction 。 |
UseTransaction(DbTransaction) |
指定用于数据库操作的现有 DbTransaction 。 |
UseTransaction(DbTransaction, Guid)
- Source:
- RelationalConnection.cs
- Source:
- RelationalConnection.cs
- Source:
- RelationalConnection.cs
- Source:
- RelationalConnection.cs
- Source:
- RelationalConnection.cs
指定用于数据库操作的现有 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;如果 为 null
,null
则为 transaction
。
实现
适用于
UseTransaction(DbTransaction)
- Source:
- RelationalConnection.cs
- Source:
- RelationalConnection.cs
- Source:
- RelationalConnection.cs
- Source:
- RelationalConnection.cs
- Source:
- RelationalConnection.cs
- Source:
- RelationalConnection.cs
- Source:
- RelationalConnection.cs
- Source:
- RelationalConnection.cs
- Source:
- RelationalConnection.cs
指定用于数据库操作的现有 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 。