IDbContextTransactionManager IDbContextTransactionManager Interface

Creates and manages the current transaction.

This interface is typically used by database providers (and other extensions). It is generally not used in application code.

Syntax

Declaration

public interface IDbContextTransactionManagerPublic Interface IDbContextTransactionManager

Properties summary

Gets the current transaction.

Methods summary

Begins a new transaction.

Asynchronously begins a new transaction.

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

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

Properties

  • CurrentTransaction
    CurrentTransaction

    Gets the current transaction.

    IDbContextTransaction CurrentTransaction { get; }ReadOnly Property CurrentTransaction As IDbContextTransaction

    Property Value

Methods

  • BeginTransaction()
    BeginTransaction()

    Begins a new transaction.

    IDbContextTransaction BeginTransaction()Function BeginTransaction As IDbContextTransaction

    Returns

  • BeginTransactionAsync(CancellationToken)
    BeginTransactionAsync(CancellationToken)

    Asynchronously begins a new transaction.

    Task<IDbContextTransaction> BeginTransactionAsync(CancellationToken cancellationToken = null)Function BeginTransactionAsync(cancellationToken As CancellationToken = Nothing) As Task(Of IDbContextTransaction)

    Parameters

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><IDbContextTransaction>
      System.Threading.Tasks.Task<TResult>(Of IDbContextTransaction)

      A task that represents the asynchronous operation. The task result contains the newly created transaction.

  • CommitTransaction()
    CommitTransaction()

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

    void CommitTransaction()Sub CommitTransaction
  • RollbackTransaction()
    RollbackTransaction()

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

    void RollbackTransaction()Sub RollbackTransaction

Details

Assembly

Microsoft.EntityFrameworkCore.dll