Condividi tramite


IDbTransactionInterceptor.TransactionStarting Metodo

Definizione

Chiamato appena prima che EF intenda chiamare BeginTransaction(IsolationLevel).

public Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbTransaction> TransactionStarting (System.Data.Common.DbConnection connection, Microsoft.EntityFrameworkCore.Diagnostics.TransactionStartingEventData eventData, Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbTransaction> result);
public virtual Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbTransaction> TransactionStarting (System.Data.Common.DbConnection connection, Microsoft.EntityFrameworkCore.Diagnostics.TransactionStartingEventData eventData, Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbTransaction> result);
abstract member TransactionStarting : System.Data.Common.DbConnection * Microsoft.EntityFrameworkCore.Diagnostics.TransactionStartingEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbTransaction> -> Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbTransaction>
abstract member TransactionStarting : System.Data.Common.DbConnection * Microsoft.EntityFrameworkCore.Diagnostics.TransactionStartingEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbTransaction> -> Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbTransaction>
override this.TransactionStarting : System.Data.Common.DbConnection * Microsoft.EntityFrameworkCore.Diagnostics.TransactionStartingEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbTransaction> -> Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbTransaction>
Public Function TransactionStarting (connection As DbConnection, eventData As TransactionStartingEventData, result As InterceptionResult(Of DbTransaction)) As InterceptionResult(Of DbTransaction)
Public Overridable Function TransactionStarting (connection As DbConnection, eventData As TransactionStartingEventData, result As InterceptionResult(Of DbTransaction)) As InterceptionResult(Of DbTransaction)

Parametri

connection
DbConnection

Connessione.

eventData
TransactionStartingEventData

Informazioni contestuali sulla connessione e sulla transazione.

result
InterceptionResult<DbTransaction>

Rappresenta il risultato corrente se esiste. Questo valore sarà HasResult impostato su true se un intercettatore precedente ha eliminato l'esecuzione chiamando SuppressWithResult(TResult). Questo valore viene in genere usato come valore restituito per l'implementazione di questo metodo.

Restituisce

Se HasResult è false, l'EF continuerà come normale. Se HasResult è true, EF elimina l'operazione che sta per eseguire e usare Result . Un'implementazione di questo metodo per qualsiasi intercettatore che non tenta di modificare il risultato consiste nel restituire il result valore passato, spesso usando FromResult<TResult>(TResult)

Si applica a