다음을 통해 공유


IDbTransactionInterceptor.TransactionStarting 메서드

정의

EF가 를 호출하기 직전에 호출 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)

매개 변수

connection
DbConnection

연결입니다.

eventData
TransactionStartingEventData

연결 및 트랜잭션에 대한 컨텍스트 정보입니다.

result
InterceptionResult<DbTransaction>

있는 경우 현재 결과를 나타냅니다. 이전의 일부 인터셉터에서 를 호출SuppressWithResult(TResult)하여 true 실행을 억제한 경우 이 값은 로 설정됩니다HasResult. 이 값은 일반적으로이 메서드의 구현에 대 한 반환 값으로 사용 합니다.

반환

가 false이면 HasResult EF는 정상적으로 계속됩니다. 가 true이면 HasResult EF가 수행하려고 하던 작업을 표시하지 않고 대신 사용합니다 Result . 결과를 변경하려고 하지 않는 인터셉터에 대해 이 메서드를 구현하는 것은 전달된 값을 반환 result 하는 것입니다( 종종 사용). FromResult<TResult>(TResult)

적용 대상