RelationalTransaction RelationalTransaction Class

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.

Syntax

Declaration

public class RelationalTransaction : IDbContextTransaction, IDisposable, IInfrastructure<DbTransaction>Public Class RelationalTransaction
    Implements IDbContextTransaction, IDisposable, IInfrastructure(Of DbTransaction)

Inheritance Hierarchy

  • System.Object
    System.Object
  • RelationalTransaction
    RelationalTransaction

Inherited Members

ToString(),
ToString(),
Equals(Object),
Equals(Object),
Equals(Object, Object),
Equals(Object, Object),
ReferenceEquals(Object, Object),
ReferenceEquals(Object, Object),
GetHashCode(),
GetHashCode(),
GetType(),
GetType(),
MemberwiseClone()
MemberwiseClone()

Constructors summary

Initializes a new instance of the RelationalTransaction class.

Methods summary

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

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

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

Explicit Interface Implementations summary

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

      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
  • Rollback()
    Rollback()

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

    public virtual void Rollback()Public Overridable Sub Rollback

Explicit Interface Implementations

  • IInfrastructure<DbTransaction>.Instance
    Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<System.Data.Common.DbTransaction>.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

Details

Assembly

Microsoft.EntityFrameworkCore.Relational.dll