Język

IDbTransactionInterceptor.CreatingSavepointAsync Metoda

Definicja

Wywoływana tuż przed utworzeniem punktu zapisywania transakcji przez program EF.

public virtual System.Threading.Tasks.ValueTask<Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult> CreatingSavepointAsync(System.Data.Common.DbTransaction transaction, Microsoft.EntityFrameworkCore.Diagnostics.TransactionEventData eventData, Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult result, System.Threading.CancellationToken cancellationToken = default);
public System.Threading.Tasks.ValueTask<Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult> CreatingSavepointAsync(System.Data.Common.DbTransaction transaction, Microsoft.EntityFrameworkCore.Diagnostics.TransactionEventData eventData, Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult result, System.Threading.CancellationToken cancellationToken = default);
abstract member CreatingSavepointAsync : System.Data.Common.DbTransaction * Microsoft.EntityFrameworkCore.Diagnostics.TransactionEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult>
override this.CreatingSavepointAsync : System.Data.Common.DbTransaction * Microsoft.EntityFrameworkCore.Diagnostics.TransactionEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult>
abstract member CreatingSavepointAsync : System.Data.Common.DbTransaction * Microsoft.EntityFrameworkCore.Diagnostics.TransactionEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult>
Public Overridable Function CreatingSavepointAsync (transaction As DbTransaction, eventData As TransactionEventData, result As InterceptionResult, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of InterceptionResult)
Public Function CreatingSavepointAsync (transaction As DbTransaction, eventData As TransactionEventData, result As InterceptionResult, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of InterceptionResult)

Parametry

transaction
DbTransaction

Transakcja.

eventData
TransactionEventData

Kontekstowe informacje o połączeniu i transakcji.

result
InterceptionResult

Reprezentuje bieżący wynik, jeśli istnieje. Ta wartość będzie miała IsSuppressed wartość , true jeśli niektóre poprzednie przechwytujące operacje pomijane przez wywołanie metody Suppress(). Ta wartość jest zwykle używana jako wartość zwracana dla implementacji tej metody.

cancellationToken
CancellationToken

Element do CancellationToken obserwowania podczas oczekiwania na ukończenie zadania.

Zwraca

Jeśli IsSuppressed ma wartość false, program EF będzie kontynuowany normalnie. Jeśli IsSuppressed ma wartość true, program EF będzie pomijać operację, która miała być wykonywana. Implementacja tej metody dla każdego przechwytnika, który nie próbuje pominąć operacji, jest zwrócenie wartości przekazanej result .

Wyjątki

Jeśli element CancellationToken zostanie anulowany.

Dotyczy