Export (0) Print
Expand All

DbContextTransaction Class

[This page is specific to the Entity Framework version 6. The latest version is available as the 'Entity Framework' NuGet package. For more information about Entity Framework, see msdn.com/data/ef.]

Wraps access to the transaction object on the underlying store connection and ensures that the Entity Framework executes commands on the database within the context of that transaction. An instance of this class is retrieved by calling BeginTransaction() on the DbContextDatabase object.


Namespace:  System.Data.Entity
Assembly:  EntityFramework (in EntityFramework.dll)

public class DbContextTransaction : IDisposable

The DbContextTransaction type exposes the following members.

Public propertyUnderlyingTransactionGets the database (store) transaction that is underlying this context transaction.

Public methodCommitCommits the underlying store transaction.
Public methodDispose()Cleans up this transaction object and ensures the Entity Framework is no longer using that transaction.
Protected methodDispose(Boolean)Releases the resources used by this transaction object.
Public methodEqualsDetermines whether this instance is equal to the specified object. (Overrides Object.Equals(Object).)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCodeReturns the hash code of the current instance. (Overrides Object.GetHashCode().)
Public methodGetTypeGets the underlying type associated with this instance.
Protected methodMemberwiseClone (Inherited from Object.)
Public methodRollbackRolls back the underlying store transaction.
Public methodToStringReturns the string representation of this instance. (Overrides Object.ToString().)

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
© 2014 Microsoft