/// <inheritdoc /> public virtual Task ReleasedSavepointAsync( DbTransaction transaction, TransactionEventData eventData, CancellationToken cancellationToken = default) => Task.CompletedTask;
/// <inheritdoc /> public virtual void ReleasedSavepoint( DbTransaction transaction, TransactionEventData eventData) { }
/// <inheritdoc /> public virtual ValueTask <InterceptionResult> ReleasingSavepointAsync( DbTransaction transaction, TransactionEventData eventData, InterceptionResult result, CancellationToken cancellationToken = default) => new ValueTask <InterceptionResult>(result);
/// <inheritdoc /> public virtual void RolledBackToSavepoint( DbTransaction transaction, TransactionEventData eventData) { }
/// <inheritdoc /> public virtual InterceptionResult ReleasingSavepoint( DbTransaction transaction, TransactionEventData eventData, InterceptionResult result) => result;
/// <inheritdoc /> public virtual void CreatedSavepoint( DbTransaction transaction, TransactionEventData eventData) { }
/// <inheritdoc /> public virtual InterceptionResult RollingBackToSavepoint( DbTransaction transaction, TransactionEventData eventData, InterceptionResult result) => result;
/// <summary> /// Called just before EF intends to call <see cref="DbTransaction.Rollback" />. /// </summary> /// <param name="transaction"> The transaction. </param> /// <param name="eventData"> Contextual information about connection and transaction. </param> /// <param name="result"> /// Represents the current result if one exists. /// This value will have <see cref="InterceptionResult.IsSuppressed" /> set to <see langword="true" /> if some previous /// interceptor suppressed execution by calling <see cref="InterceptionResult.Suppress" />. /// This value is typically used as the return value for the implementation of this method. /// </param> /// <returns> /// If <see cref="InterceptionResult.IsSuppressed" /> is false, the EF will continue as normal. /// If <see cref="InterceptionResult.IsSuppressed" /> is true, then EF will suppress the operation /// it was about to perform. /// A normal implementation of this method for any interceptor that is not attempting to suppress /// the operation is to return the <paramref name="result" /> value passed in. /// </returns> public virtual InterceptionResult TransactionRollingBack( DbTransaction transaction, TransactionEventData eventData, InterceptionResult result) => result;
/// <summary> /// Called just before EF intends to call /// <see cref="M:System.Data.Common.DbTransaction.RollbackAsync(System.Threading.CancellationToken)" />. /// </summary> /// <param name="transaction"> The transaction. </param> /// <param name="eventData"> Contextual information about connection and transaction. </param> /// <param name="result"> /// Represents the current result if one exists. /// This value will have <see cref="InterceptionResult.IsSuppressed" /> set to <see langword="true" /> if some previous /// interceptor suppressed execution by calling <see cref="InterceptionResult.Suppress" />. /// This value is typically used as the return value for the implementation of this method. /// </param> /// <param name="cancellationToken"> The cancellation token. </param> /// <returns> /// If <see cref="InterceptionResult.IsSuppressed" /> is false, the EF will continue as normal. /// If <see cref="InterceptionResult.IsSuppressed" /> is true, then EF will suppress the operation /// it was about to perform. /// A normal implementation of this method for any interceptor that is not attempting to suppress /// the operation is to return the <paramref name="result" /> value passed in. /// </returns> public virtual ValueTask <InterceptionResult> TransactionRollingBackAsync( DbTransaction transaction, TransactionEventData eventData, InterceptionResult result, CancellationToken cancellationToken = default) => new ValueTask <InterceptionResult>(result);
/// <summary> /// Called just before EF intends to call <see cref="DbTransaction.Commit" />. /// </summary> /// <param name="transaction"> The transaction. </param> /// <param name="eventData"> Contextual information about connection and transaction. </param> /// <param name="result"> /// Represents the current result if one exists. /// This value will have <see cref="InterceptionResult.IsSuppressed" /> set to <see langword="true" /> if some previous /// interceptor suppressed execution by calling <see cref="InterceptionResult.Suppress" />. /// This value is typically used as the return value for the implementation of this method. /// </param> /// <returns> /// If <see cref="InterceptionResult.IsSuppressed" /> is false, the EF will continue as normal. /// If <see cref="InterceptionResult.IsSuppressed" /> is true, then EF will suppress the operation /// it was about to perform. /// A normal implementation of this method for any interceptor that is not attempting to suppress /// the operation is to return the <paramref name="result" /> value passed in. /// </returns> public virtual InterceptionResult TransactionCommitting( DbTransaction transaction, TransactionEventData eventData, InterceptionResult result) => result;
/// <summary> /// <para> /// Called immediately after <see cref="M:RelationalDatabaseFacadeExtensions.UseTransactionAsync" /> is called. /// </para> /// </summary> /// <param name="connection"> The connection. </param> /// <param name="eventData"> Contextual information about connection and transaction. </param> /// <param name="result"> /// The <see cref="DbTransaction" /> that was passed to <see cref="M:RelationalDatabaseFacadeExtensions.UseTransactionAsync" />. /// This value is typically used as the return value for the implementation of this method. /// </param> /// <param name="cancellationToken"> The cancellation token. </param> /// <returns> /// A <see cref="Task" /> containing the value that will be used as the effective value passed /// to <see cref="M:RelationalDatabaseFacadeExtensions.UseTransactionAsync" /> /// A normal implementation of this method for any interceptor that is not attempting to change the result /// is to return the <paramref name="result" /> value passed in, often using <see cref="Task.FromResult{TResult}" /> /// </returns> public virtual ValueTask <DbTransaction> TransactionUsedAsync( DbConnection connection, TransactionEventData eventData, DbTransaction result, CancellationToken cancellationToken = default) => new ValueTask <DbTransaction>(result);
/// <summary> /// <para> /// Called immediately after <see cref="M:RelationalDatabaseFacadeExtensions.UseTransaction" /> is called. /// </para> /// </summary> /// <param name="connection"> The connection. </param> /// <param name="eventData"> Contextual information about connection and transaction. </param> /// <param name="result"> /// The <see cref="DbTransaction" /> that was passed to <see cref="M:RelationalDatabaseFacadeExtensions.UseTransaction" />. /// This value is typically used as the return value for the implementation of this method. /// </param> /// <returns> /// The value that will be used as the effective value passed to <see cref="M:RelationalDatabaseFacadeExtensions.UseTransaction" /> /// A normal implementation of this method for any interceptor that is not attempting to change the result /// is to return the <paramref name="result" /> value passed in. /// </returns> public virtual DbTransaction TransactionUsed( DbConnection connection, TransactionEventData eventData, DbTransaction result) => result;
/// <summary> /// Called just before EF intends to call <see cref="DbTransaction.RollbackAsync" />. /// </summary> /// <param name="transaction"> The transaction. </param> /// <param name="eventData"> Contextual information about connection and transaction. </param> /// <param name="result"> /// The current result, or null if no result yet exists. /// This value will be non-null if some previous interceptor suppressed rolling back returning a result from /// its implementation of this method. /// This value is typically used as the return value for the implementation of this method. /// </param> /// <param name="cancellationToken"> The cancellation token. </param> /// <returns> /// If the <see cref="Task" /> result is null, then EF will roll back the transaction as normal. /// If the <see cref="Task" /> result is non-null value, rolling back the transaction is suppressed. /// A normal implementation of this method for any interceptor that is not attempting to change the result /// is to return the <paramref name="result" /> value passed in, often using <see cref="Task.FromResult{TResult}" /> /// </returns> public virtual Task <InterceptionResult?> TransactionRollingBackAsync( DbTransaction transaction, TransactionEventData eventData, InterceptionResult?result, CancellationToken cancellationToken = default) => Task.FromResult(result);
/// <summary> /// <para> /// Called immediately after <see cref="RelationalDatabaseFacadeExtensions.UseTransactionAsync" /> is called. /// </para> /// </summary> /// <param name="connection"> The connection. </param> /// <param name="eventData"> Contextual information about connection and transaction. </param> /// <param name="result"> /// The <see cref="DbTransaction" /> that was passed to <see cref="RelationalDatabaseFacadeExtensions.UseTransactionAsync" />. /// This value is typically used as the return value for the implementation of this method. /// </param> /// <param name="cancellationToken"> The cancellation token. </param> /// <returns> /// A <see cref="Task" /> containing the value that will be used as the effective value passed /// to <see cref="RelationalDatabaseFacadeExtensions.UseTransactionAsync" /> /// A normal implementation of this method for any interceptor that is not attempting to change the result /// is to return the <paramref name="result" /> value passed in, often using <see cref="Task.FromResult{TResult}" /> /// </returns> public virtual Task <DbTransaction> TransactionUsedAsync( DbConnection connection, TransactionEventData eventData, DbTransaction result, CancellationToken cancellationToken = default) => Task.FromResult(result);