Search Results for

    Show / Hide Table of Contents

    Class OutboxInterceptor

    An EF Core SaveChangesInterceptor that, before saving changes, extracts domain events from aggregate roots and persists the configured subset as OutboxMessage records.

    Inheritance
    object
    SaveChangesInterceptor
    OutboxInterceptor
    Implements
    ISaveChangesInterceptor
    IInterceptor
    Inherited Members
    SaveChangesInterceptor.SavingChanges(DbContextEventData, InterceptionResult<int>)
    SaveChangesInterceptor.SavedChanges(SaveChangesCompletedEventData, int)
    SaveChangesInterceptor.SaveChangesFailed(DbContextErrorEventData)
    SaveChangesInterceptor.SavedChangesAsync(SaveChangesCompletedEventData, int, CancellationToken)
    SaveChangesInterceptor.SaveChangesFailedAsync(DbContextErrorEventData, CancellationToken)
    SaveChangesInterceptor.SaveChangesCanceled(DbContextEventData)
    SaveChangesInterceptor.SaveChangesCanceledAsync(DbContextEventData, CancellationToken)
    SaveChangesInterceptor.ThrowingConcurrencyException(ConcurrencyExceptionEventData, InterceptionResult)
    SaveChangesInterceptor.ThrowingConcurrencyExceptionAsync(ConcurrencyExceptionEventData, InterceptionResult, CancellationToken)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Chapar.Outbox.EntityFrameworkCore.Interceptors
    Assembly: Chapar.Outbox.EntityFrameworkCore.dll
    Syntax
    public sealed class OutboxInterceptor : SaveChangesInterceptor, ISaveChangesInterceptor, IInterceptor

    Constructors

    | Edit this page View Source

    OutboxInterceptor(IOutboxStore, IOptions<ChaparOutboxOptions>)

    Initializes a new instance of the OutboxInterceptor class.

    Declaration
    public OutboxInterceptor(IOutboxStore outboxStore, IOptions<ChaparOutboxOptions> options)
    Parameters
    Type Name Description
    IOutboxStore outboxStore

    The store responsible for persisting outbox messages.

    IOptions<ChaparOutboxOptions> options

    The outbox options.

    Methods

    | Edit this page View Source

    SavingChangesAsync(DbContextEventData, InterceptionResult<int>, CancellationToken)

    Called at the start of .

    Declaration
    public override ValueTask<InterceptionResult<int>> SavingChangesAsync(DbContextEventData eventData, InterceptionResult<int> result, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    DbContextEventData eventData

    Contextual information about the DbContext being used.

    InterceptionResult<int> result

    Represents the current result if one exists. This value will have HasResult set to true if some previous interceptor suppressed execution by calling SuppressWithResult(TResult). This value is typically used as the return value for the implementation of this method.

    CancellationToken cancellationToken

    A CancellationToken to observe while waiting for the task to complete.

    Returns
    Type Description
    ValueTask<InterceptionResult<int>>

    If HasResult is false, the EF will continue as normal. If HasResult is true, then EF will suppress the operation it was about to perform and use Result instead. An implementation of this method for any interceptor that is not attempting to change the result is to return the result value passed in.

    Overrides
    SaveChangesInterceptor.SavingChangesAsync(DbContextEventData, InterceptionResult<int>, CancellationToken)
    Exceptions
    Type Condition
    OperationCanceledException

    If the CancellationToken is canceled.

    Implements

    ISaveChangesInterceptor
    IInterceptor
    • Edit this page
    • View Source
    In this article
    Back to top Copyright © 2026