/// <summary> /// <para> /// Called immediately after EF calls <see cref="DbCommand.ExecuteReaderAsync()" />. /// </para> /// <para> /// This method is still called if an interceptor suppressed execution of a command in <see cref="ReaderExecutingAsync" />. /// In this case, <paramref name="result" /> is the result returned by <see cref="ReaderExecutingAsync" />. /// </para> /// </summary> /// <param name="command"> The command. </param> /// <param name="eventData"> Contextual information about the command and execution. </param> /// <param name="result"> /// The result of the call to <see cref="DbCommand.ExecuteReaderAsync()" />. /// 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" /> providing the result that EF will use. /// 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 <DbDataReader> ReaderExecutedAsync( DbCommand command, CommandExecutedEventData eventData, DbDataReader result, CancellationToken cancellationToken = default) => Task.FromResult(result);
/// <summary> /// <para> /// Called immediately after EF calls <see cref="DbCommand.ExecuteScalarAsync()" />. /// </para> /// <para> /// This method is still called if an interceptor suppressed execution of a command in <see cref="ScalarExecutingAsync" />. /// In this case, <paramref name="result" /> is the result returned by <see cref="ScalarExecutingAsync" />. /// </para> /// </summary> /// <param name="command"> The command. </param> /// <param name="eventData"> Contextual information about the command and execution. </param> /// <param name="result"> /// The result of the call to <see cref="DbCommand.ExecuteScalarAsync()" />. /// 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" /> providing the result that EF will use. /// 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 <object> ScalarExecutedAsync( DbCommand command, CommandExecutedEventData eventData, object result, CancellationToken cancellationToken = default) => Task.FromResult(result);
/// <summary> /// <para> /// Called immediately after EF calls <see cref="DbCommand.ExecuteNonQuery()" />. /// </para> /// <para> /// This method is still called if an interceptor suppressed execution of a command in <see cref="NonQueryExecuting" />. /// In this case, <paramref name="result" /> is the result returned by <see cref="NonQueryExecuting" />. /// </para> /// </summary> /// <param name="command"> The command. </param> /// <param name="eventData"> Contextual information about the command and execution. </param> /// <param name="result"> /// The result of the call to <see cref="DbCommand.ExecuteNonQuery()" />. /// This value is typically used as the return value for the implementation of this method. /// </param> /// <returns> /// The result that EF will use. /// 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 int NonQueryExecuted( DbCommand command, CommandExecutedEventData eventData, int result) => result;
/// <summary> /// <para> /// Called immediately after EF calls <see cref="DbCommand.ExecuteScalar()" />. /// </para> /// <para> /// This method is still called if an interceptor suppressed execution of a command in <see cref="ScalarExecuting" />. /// In this case, <paramref name="result" /> is the result returned by <see cref="ScalarExecuting" />. /// </para> /// </summary> /// <param name="command"> The command. </param> /// <param name="eventData"> Contextual information about the command and execution. </param> /// <param name="result"> /// The result of the call to <see cref="DbCommand.ExecuteScalar()" />. /// This value is typically used as the return value for the implementation of this method. /// </param> /// <returns> /// The result that EF will use. /// 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 object ScalarExecuted( DbCommand command, CommandExecutedEventData eventData, object result) => result;
/// <summary> /// <para> /// Called immediately after EF calls <see cref="DbCommand.ExecuteReader()" />. /// </para> /// <para> /// This method is still called if an interceptor suppressed execution of a command in <see cref="ReaderExecuting" />. /// In this case, <paramref name="result" /> is the result returned by <see cref="ReaderExecuting" />. /// </para> /// </summary> /// <param name="command"> The command. </param> /// <param name="eventData"> Contextual information about the command and execution. </param> /// <param name="result"> /// The result of the call to <see cref="DbCommand.ExecuteReader()" />. /// This value is typically used as the return value for the implementation of this method. /// </param> /// <returns> /// The result that EF will use. /// 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 DbDataReader ReaderExecuted( DbCommand command, CommandExecutedEventData eventData, DbDataReader result) => result;
/// <summary> /// <para> /// Called immediately after EF calls <see cref="DbCommand.ExecuteNonQueryAsync()" />. /// </para> /// <para> /// This method is still called if an interceptor suppressed execution of a command in <see cref="NonQueryExecutingAsync" />. /// In this case, <paramref name="result" /> is the result returned by <see cref="NonQueryExecutingAsync" />. /// </para> /// </summary> /// <param name="command"> The command. </param> /// <param name="eventData"> Contextual information about the command and execution. </param> /// <param name="result"> /// The result of the call to <see cref="DbCommand.ExecuteNonQueryAsync()" />. /// 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" /> providing the result that EF will use. /// 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 <int> NonQueryExecutedAsync( DbCommand command, CommandExecutedEventData eventData, int result, CancellationToken cancellationToken = default) => Task.FromResult(result);
/// <summary> /// <para> /// Called immediately after EF calls <see cref="DbCommand.ExecuteNonQueryAsync()" />. /// </para> /// <para> /// This method is still called if an interceptor suppressed execution of a command in <see cref="NonQueryExecutingAsync" />. /// In this case, <paramref name="result" /> is the result returned by <see cref="NonQueryExecutingAsync" />. /// </para> /// </summary> /// <param name="command"> The command. </param> /// <param name="eventData"> Contextual information about the command and execution. </param> /// <param name="result"> /// The result of the call to <see cref="DbCommand.ExecuteNonQueryAsync()" />. /// This value is typically used as the return value for the implementation of this method. /// </param> /// <param name="cancellationToken"> A <see cref="CancellationToken" /> to observe while waiting for the task to complete. </param> /// <returns> /// A <see cref="Task" /> providing the result that EF will use. /// 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> /// <exception cref="OperationCanceledException"> If the <see cref="CancellationToken"/> is canceled. </exception> public virtual ValueTask <int> NonQueryExecutedAsync( DbCommand command, CommandExecutedEventData eventData, int result, CancellationToken cancellationToken = default) => new ValueTask <int>(result);