TransactionContext TransactionContext TransactionContext Class

Definition

This class is used by CommitFailureHandler to write and read transaction tracing information from the database. To customize the definition of the transaction table you can derive from this class and override OnModelCreating(DbModelBuilder). Derived classes can be registered using DbConfiguration.

public class TransactionContext : System.Data.Entity.DbContext
type TransactionContext = class
    inherit DbContext
Public Class TransactionContext
Inherits DbContext
Inheritance
TransactionContextTransactionContextTransactionContext

Remarks

By default EF will poll the resolved TransactionContext to check wether the database schema is compatible and will try to modify it accordingly if it's not. To disable this check call

Database.SetInitializer<TTransactionContext>(null)
where TTransactionContext is the type of the resolved context.

Constructors

TransactionContext(DbConnection) TransactionContext(DbConnection) TransactionContext(DbConnection)

Initializes a new instance of the TransactionContext class.

Properties

ChangeTracker ChangeTracker ChangeTracker

Provides access to features of the context that deal with change tracking of entities.

(Inherited from DbContext)
Configuration Configuration Configuration

Provides access to configuration options for the context.

(Inherited from DbContext)
Database Database Database

Creates a Database instance for this context that allows for creation/deletion/existence checks for the underlying database.

(Inherited from DbContext)
IObjectContextAdapter.ObjectContext IObjectContextAdapter.ObjectContext IObjectContextAdapter.ObjectContext

Returns the Entity Framework ObjectContext that is underlying this context.

(Inherited from DbContext)
Transactions Transactions Transactions

Gets or sets a DbSet<TEntity> that can be used to read and write TransactionRow instances.

Methods

Dispose() Dispose() Dispose()

Calls the protected Dispose method.

(Inherited from DbContext)
Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

Disposes the context. The underlying ObjectContext is also disposed if it was created is by this context or ownership was passed to this context when this context was created. The connection to the database (DbConnection object) is also disposed if it was created is by this context or ownership was passed to this context when this context was created.

(Inherited from DbContext)
Entry(Object) Entry(Object) Entry(Object)

Gets a DbEntityEntry object for the given entity providing access to information about the entity and the ability to perform actions on the entity.

(Inherited from DbContext)
Entry<TEntity>(TEntity) Entry<TEntity>(TEntity) Entry<TEntity>(TEntity)

Gets a DbEntityEntry<TEntity> object for the given entity providing access to information about the entity and the ability to perform actions on the entity.

(Inherited from DbContext)
Equals(Object) Equals(Object) Equals(Object) Inherited from DbContext
GetHashCode() GetHashCode() GetHashCode() Inherited from DbContext
GetType() GetType() GetType() Inherited from DbContext
GetValidationErrors() GetValidationErrors() GetValidationErrors()

Validates tracked entities and returns a Collection of DbEntityValidationResult containing validation results.

(Inherited from DbContext)
OnModelCreating(DbModelBuilder) OnModelCreating(DbModelBuilder) OnModelCreating(DbModelBuilder)
SaveChanges() SaveChanges() SaveChanges()

Saves all changes made in this context to the underlying database.

(Inherited from DbContext)
SaveChangesAsync() SaveChangesAsync() SaveChangesAsync()

Asynchronously saves all changes made in this context to the underlying database.

(Inherited from DbContext)
SaveChangesAsync(CancellationToken) SaveChangesAsync(CancellationToken) SaveChangesAsync(CancellationToken)

Asynchronously saves all changes made in this context to the underlying database.

(Inherited from DbContext)
Set(Type) Set(Type) Set(Type)

Returns a non-generic DbSet instance for access to entities of the given type in the context and the underlying store.

(Inherited from DbContext)
Set<TEntity>() Set<TEntity>() Set<TEntity>()

Returns a DbSet<TEntity> instance for access to entities of the given type in the context and the underlying store.

(Inherited from DbContext)
ShouldValidateEntity(DbEntityEntry) ShouldValidateEntity(DbEntityEntry) ShouldValidateEntity(DbEntityEntry)

Extension point allowing the user to override the default behavior of validating only added and modified entities.

(Inherited from DbContext)
ToString() ToString() ToString() Inherited from DbContext
ValidateEntity(DbEntityEntry, IDictionary<Object,Object>) ValidateEntity(DbEntityEntry, IDictionary<Object,Object>) ValidateEntity(DbEntityEntry, IDictionary<Object,Object>)

Extension point allowing the user to customize validation of an entity or filter out validation results. Called by GetValidationErrors().

(Inherited from DbContext)

Applies to