Skip to content
ModularityKit.Mutator ModularityKit.Mutator Docs
  • Home
  • Core
  • Governance
  • Redis
  • API
Search Results for

    Show / Hide Table of Contents

    Interface IMutationInterceptor

    Interceptor for mutation execution. Allows observing and reacting to mutations at various stages: before execution, after execution, on failure, or when blocked by policy.

    Namespace: ModularityKit.Mutator.Abstractions.Interception
    Assembly: ModularityKit.Mutator.dll
    Syntax
    public interface IMutationInterceptor
    Remarks

    Interceptors are executed in order based on the Order property (lower values run first). They can be used for logging, auditing, validation, side effects, or monitoring mutation workflows.

    Properties

    | Edit this page View Source

    Name

    Unique name of the interceptor.

    Declaration
    string Name { get; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    Order

    Execution order of the interceptor (lower numbers run first).

    Declaration
    int Order { get; }
    Property Value
    Type Description
    int

    Methods

    | Edit this page View Source

    OnAfterMutationAsync(MutationIntent, MutationContext, object?, object?, ChangeSet, string, CancellationToken)

    Called after the mutation has successfully executed.

    Declaration
    Task OnAfterMutationAsync(MutationIntent intent, MutationContext context, object? oldState, object? newState, ChangeSet changes, string executionId, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    MutationIntent intent
    MutationContext context
    object oldState
    object newState
    ChangeSet changes
    string executionId
    CancellationToken cancellationToken
    Returns
    Type Description
    Task
    | Edit this page View Source

    OnBeforeMutationAsync(MutationIntent, MutationContext, object, string, CancellationToken)

    Called before the mutation is executed.

    Declaration
    Task OnBeforeMutationAsync(MutationIntent intent, MutationContext context, object state, string executionId, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    MutationIntent intent
    MutationContext context
    object state
    string executionId
    CancellationToken cancellationToken
    Returns
    Type Description
    Task
    | Edit this page View Source

    OnMutationFailedAsync(MutationIntent, MutationContext, object, Exception, string, CancellationToken)

    Called when the mutation execution fails with an exception.

    Declaration
    Task OnMutationFailedAsync(MutationIntent intent, MutationContext context, object state, Exception exception, string executionId, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    MutationIntent intent
    MutationContext context
    object state
    Exception exception
    string executionId
    CancellationToken cancellationToken
    Returns
    Type Description
    Task
    | Edit this page View Source

    OnPolicyBlockedAsync(MutationIntent, MutationContext, object, PolicyDecision, string, CancellationToken)

    Called when the mutation is blocked by a policy decision.

    Declaration
    Task OnPolicyBlockedAsync(MutationIntent intent, MutationContext context, object state, PolicyDecision decision, string executionId, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    MutationIntent intent
    MutationContext context
    object state
    PolicyDecision decision
    string executionId
    CancellationToken cancellationToken
    Returns
    Type Description
    Task
    • Edit this page
    • View Source
    In this article
    ModularityKit.Mutator Generated from XML docs and published from main. Back to top