Database.UseTransaction(DbTransaction) 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.
Enables the user to pass in a database transaction created outside of the Database object if you want the Entity Framework to execute commands within that external transaction. Alternatively, pass in null to clear the framework's knowledge of that transaction.
public void UseTransaction (System.Data.Common.DbTransaction transaction);
member this.UseTransaction : System.Data.Common.DbTransaction -> unit
Public Sub UseTransaction (transaction As DbTransaction)
Parameters
- transaction
- DbTransaction
the external transaction
Exceptions
Thrown if the connection associated with the transaction does not match the Entity Framework's connection
Applies to
Entity Framework