EntityConnection.BeginTransaction 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
BeginTransaction() |
Begins a transaction by using the underlying provider. |
BeginTransaction(IsolationLevel) |
Begins a transaction with the specified isolation level by using the underlying provider. |
BeginTransaction()
Begins a transaction by using the underlying provider.
public virtual System.Data.Entity.Core.EntityClient.EntityTransaction BeginTransaction ();
override this.BeginTransaction : unit -> System.Data.Entity.Core.EntityClient.EntityTransaction
Public Overridable Function BeginTransaction () As EntityTransaction
Returns
A new EntityTransaction. The returned EntityTransaction instance can later be associated with the EntityCommand to execute the command under that transaction.
Exceptions
The underlying provider is not known.-or-The call to BeginTransaction() was made on an EntityConnection that already has a current transaction.-or-The state of the EntityConnection is not Open .
Applies to
BeginTransaction(IsolationLevel)
Begins a transaction with the specified isolation level by using the underlying provider.
public virtual System.Data.Entity.Core.EntityClient.EntityTransaction BeginTransaction (System.Data.IsolationLevel isolationLevel);
override this.BeginTransaction : System.Data.IsolationLevel -> System.Data.Entity.Core.EntityClient.EntityTransaction
Parameters
- isolationLevel
- IsolationLevel
The isolation level of the transaction.
Returns
A new EntityTransaction. The returned EntityTransaction instance can later be associated with the EntityCommand to execute the command under that transaction.
Exceptions
The underlying provider is not known.-or-The call to BeginTransaction() was made on an EntityConnection that already has a current transaction.-or-The state of the EntityConnection is not Open .
Applies to
Entity Framework