EntityConnection::BeginTransaction Method
Begins a database transaction.
Assembly: EntityFramework (in EntityFramework.dll)
| Name | Description | |
|---|---|---|
![]() | BeginTransaction() | Begins a transaction by using the underlying provider. |
![]() | BeginTransaction(IsolationLevel) | Begins a transaction with the specified isolation level by using the underlying provider. |
EntityConnection::BeginTransaction Method ()
Begins a transaction by using the underlying provider.
Return Value
Type: System.Data.Entity.Core.EntityClient::EntityTransaction^A new EntityTransaction. The returned EntityTransaction instance can later be associated with the EntityCommand to execute the command under that transaction.
| Exception | Condition |
|---|---|
| InvalidOperationException | 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 . |
EntityConnection::BeginTransaction Method (IsolationLevel)
Begins a transaction with the specified isolation level by using the underlying provider.
Parameters
- isolationLevel
-
Type:
System.Data::IsolationLevel
The isolation level of the transaction.
Return Value
Type: System.Data.Entity.Core.EntityClient::EntityTransaction^A new EntityTransaction. The returned EntityTransaction instance can later be associated with the EntityCommand to execute the command under that transaction.
| Exception | Condition |
|---|---|
| InvalidOperationException | 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 . |
