RelationalTransaction RelationalTransaction Class

Definition

A transaction against the database.

Instances of this class are typically obtained from BeginTransaction() and it is not designed to be directly constructed in your application code.

public class RelationalTransaction : IDbContextTransaction, IDisposable, IInfrastructure<DbTransaction>
Public Class RelationalTransaction
    Implements IDbContextTransaction, IDisposable, IInfrastructure(Of DbTransaction)
Inheritance
System.ObjectSystem.Object
RelationalTransactionRelationalTransaction
Implements
IDbContextTransactionIDbContextTransaction System.IDisposableSystem.IDisposable IInfrastructure<System.Data.Common.DbTransaction>IInfrastructure(Of System.Data.Common.DbTransaction)

Constructors

RelationalTransaction(IRelationalConnection, DbTransaction, ILogger, Boolean) RelationalTransaction(IRelationalConnection, DbTransaction, ILogger, Boolean)

Initializes a new instance of the RelationalTransaction class.

public RelationalTransaction(IRelationalConnection connection, DbTransaction transaction, ILogger logger, bool transactionOwned)
Public Sub New(connection As IRelationalConnection, transaction As DbTransaction, logger As ILogger, transactionOwned As Boolean)
Parameters
connection
IRelationalConnection IRelationalConnection

The connection to the database.

transaction
System.Data.Common.DbTransaction System.Data.Common.DbTransaction

The underlying System.Data.Common.DbTransaction.

logger
ILogger ILogger

The logger to write to.

transactionOwned
System.Boolean System.Boolean

A value indicating whether the transaction is owned by this class (i.e. if it can be disposed when this class is disposed).

Methods

Commit() Commit()

Commits all changes made to the database in the current transaction.

public virtual void Commit()
Public Overridable Sub Commit

Dispose() Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public virtual void Dispose()
Public Overridable Sub Dispose

Equals(Object) Equals(Object)

Inherited from System.Object

Equals(Object, Object) Equals(Object, Object)

Inherited from System.Object

GetHashCode() GetHashCode()

Inherited from System.Object

GetType() GetType()

Inherited from System.Object

MemberwiseClone() MemberwiseClone()

Inherited from System.Object

ReferenceEquals(Object, Object) ReferenceEquals(Object, Object)

Inherited from System.Object

Rollback() Rollback()

Discards all changes made to the database in the current transaction.

public virtual void Rollback()
Public Overridable Sub Rollback

ToString() ToString()

Inherited from System.Object

Explicit Interface Implementations

IInfrastructure.Instance Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure.Instance

DbTransaction IInfrastructure<DbTransaction>.Instance { get; }
ReadOnly WriteOnly Property Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<System.Data.Common.DbTransaction>.Instance As DbTransaction Implements IInfrastructure(Of DbTransaction).Instance
Returns
System.Data.Common.DbTransaction System.Data.Common.DbTransaction