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

    Show / Hide Table of Contents

    Class MutationContext

    Represents the execution context of a mutation. Answers the questions: WHO, WHEN, WHY, and HOW the mutation is performed.

    Inheritance
    object
    MutationContext
    Implements
    IEquatable<MutationContext>
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: ModularityKit.Mutator.Abstractions.Context
    Assembly: ModularityKit.Mutator.dll
    Syntax
    public sealed record MutationContext : IEquatable<MutationContext>
    Remarks

    This context provides metadata for auditing, tracking, and governance of mutations within the system. It captures information about the actor (user, system, or service), the reason for the mutation, timestamps, correlation identifiers, and additional metadata.

    Common usage:

    • Audit trails
    • Correlation and causation in distributed systems
    • Simulation and validation of mutations

    Properties

    | Edit this page View Source

    ActorId

    Identifier of the actor performing the mutation.

    Declaration
    public string? ActorId { get; init; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    ActorName

    Human-readable name of the actor.

    Declaration
    public string? ActorName { get; init; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    CausationId

    ID of the command or event that caused this mutation.

    Declaration
    public string? CausationId { get; init; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    CorrelationId

    Correlation ID for distributed system tracking.

    Declaration
    public string? CorrelationId { get; init; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    Culture

    Culture of the actor (e.g., "en-US").

    Declaration
    public string? Culture { get; init; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    Metadata

    Additional contextual metadata for the mutation.

    Declaration
    public IReadOnlyDictionary<string, object> Metadata { get; init; }
    Property Value
    Type Description
    IReadOnlyDictionary<string, object>
    | Edit this page View Source

    Mode

    Mode of mutation execution (commit, dry-run, etc.).

    Declaration
    public MutationMode Mode { get; init; }
    Property Value
    Type Description
    MutationMode
    | Edit this page View Source

    Reason

    Reason for performing the mutation.

    Declaration
    public string? Reason { get; init; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    SessionId

    User session identifier.

    Declaration
    public string? SessionId { get; init; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    SourceIpAddress

    Source IP address (if applicable).

    Declaration
    public string? SourceIpAddress { get; init; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    StateId

    Identifier of the state being mutated (if applicable).

    Declaration
    public string? StateId { get; init; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    TimeZone

    Time zone of the actor.

    Declaration
    public TimeZoneInfo? TimeZone { get; init; }
    Property Value
    Type Description
    TimeZoneInfo
    | Edit this page View Source

    Timestamp

    Timestamp when the mutation was initiated.

    Declaration
    public DateTimeOffset Timestamp { get; init; }
    Property Value
    Type Description
    DateTimeOffset
    | Edit this page View Source

    UserAgent

    User agent string (if applicable).

    Declaration
    public string? UserAgent { get; init; }
    Property Value
    Type Description
    string

    Methods

    | Edit this page View Source

    Service(string, string)

    Creates a service-level mutation context.

    Declaration
    public static MutationContext Service(string serviceId, string reason)
    Parameters
    Type Name Description
    string serviceId

    Service ID performing the mutation.

    string reason

    Reason for the service mutation.

    Returns
    Type Description
    MutationContext

    A MutationContext representing a service actor.

    | Edit this page View Source

    System(string, string?)

    Creates a system-level mutation context.

    Declaration
    public static MutationContext System(string reason, string? correlationId = null)
    Parameters
    Type Name Description
    string reason

    Reason for the system mutation.

    string correlationId

    Optional correlation ID.

    Returns
    Type Description
    MutationContext

    A MutationContext representing a system actor.

    | Edit this page View Source

    User(string, string?, string?)

    Creates a user-level mutation context.

    Declaration
    public static MutationContext User(string userId, string? userName = null, string? reason = null)
    Parameters
    Type Name Description
    string userId

    User ID performing the mutation.

    string userName

    Optional username.

    string reason

    Optional reason for mutation.

    Returns
    Type Description
    MutationContext

    A MutationContext representing a user actor.

    Implements

    IEquatable<T>
    • Edit this page
    • View Source
    In this article
    ModularityKit.Mutator Generated from XML docs and published from main. Back to top