RelationalConnection.UseTransaction Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
UseTransaction(DbTransaction, Guid) |
Specifies an existing DbTransaction to be used for database operations. |
UseTransaction(DbTransaction) |
Specifies an existing DbTransaction to be used for database operations. |
UseTransaction(DbTransaction, Guid)
Specifies an existing DbTransaction to be used for database operations.
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
Parameters
- transaction
- DbTransaction
The transaction to be used.
- transactionId
- Guid
The unique identifier for the transaction.
Returns
An instance of IDbContextTransaction that wraps the provided transaction, or null
if transaction
is null
.
Implements
Applies to
UseTransaction(DbTransaction)
Specifies an existing DbTransaction to be used for database operations.
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
Parameters
- transaction
- DbTransaction
The transaction to be used.
Returns
An instance of IDbTransaction that wraps the provided transaction.
Implements
Applies to
Entity Framework