RelationalDatabaseFacadeExtensions.UseTransaction(DatabaseFacade, DbTransaction) Method

Definition

Sets the DbTransaction to be used by database operations on the DbContext.

public static Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction UseTransaction (this Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade databaseFacade, System.Data.Common.DbTransaction transaction);
static member UseTransaction : Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade * System.Data.Common.DbTransaction -> Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction

Parameters

databaseFacade
DatabaseFacade

The DatabaseFacade for the context.

transaction
DbTransaction

The DbTransaction to use.

Returns

IDbContextTransaction

A IDbContextTransaction that encapsulates the given transaction.

Applies to