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

    Show / Hide Table of Contents

    Class SideEffect

    Represents a side effect produced by a mutation. Side effects capture additional consequences that are not part of the primary state change.

    Inheritance
    object
    SideEffect
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: ModularityKit.Mutator.Abstractions.Effects
    Assembly: ModularityKit.Mutator.dll
    Syntax
    [JsonConverter(typeof(SideEffectJsonConverter))]
    public sealed class SideEffect

    Properties

    | Edit this page View Source

    Data

    Optional data associated with the side effect. Can hold structured information for logging, auditing, or downstream processing.

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

    DataContractType

    Stable contract identifier for typed side effect payloads.

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

    DataContractVersion

    Version number for typed side effect payloads.

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

    Description

    Human-readable description of the side effect.

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

    RequiresAction

    Indicates whether this side effect requires an explicit action or intervention.

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

    Severity

    Severity of the side effect. Determines the criticality or importance for monitoring and alerting.

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

    Timestamp

    Timestamp when the side effect occurred.

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

    Type

    The type of the side effect (e.g., "Notification", "AuditLog", "ExternalCall").

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

    Methods

    | Edit this page View Source

    Create(string, string, object?, SideEffectSeverity, bool, DateTimeOffset?)

    Creates a new SideEffect with the specified properties.

    Declaration
    public static SideEffect Create(string type, string description, object? data = null, SideEffectSeverity severity = SideEffectSeverity.Info, bool requiresAction = false, DateTimeOffset? timestamp = null)
    Parameters
    Type Name Description
    string type

    The type of the side effect.

    string description

    Human-readable description.

    object data

    Optional associated data. When the payload type declares SideEffectDataContractAttribute, the side effect contract metadata is populated automatically.

    SideEffectSeverity severity

    Severity level.

    bool requiresAction

    Indicates whether the side effect requires explicit follow-up. Critical severity always implies action.

    DateTimeOffset? timestamp

    Optional timestamp override. Defaults to current UTC time.

    Returns
    Type Description
    SideEffect
    | Edit this page View Source

    Create<TData>(string, string, TData, SideEffectSeverity, bool, DateTimeOffset?)

    Creates a new SideEffect with a typed payload contract.

    Declaration
    public static SideEffect Create<TData>(string type, string description, TData data, SideEffectSeverity severity = SideEffectSeverity.Info, bool requiresAction = false, DateTimeOffset? timestamp = null)
    Parameters
    Type Name Description
    string type

    The type of the side effect.

    string description

    Human-readable description.

    TData data

    Typed associated payload.

    SideEffectSeverity severity

    Severity level.

    bool requiresAction

    Indicates whether the side effect requires explicit follow-up. Critical severity always implies action.

    DateTimeOffset? timestamp

    Optional timestamp override. Defaults to current UTC time.

    Returns
    Type Description
    SideEffect
    Type Parameters
    Name Description
    TData

    The payload type.

    | Edit this page View Source

    Critical(string, string, object?, DateTimeOffset?)

    Creates a new critical SideEffect instance.

    Declaration
    public static SideEffect Critical(string type, string description, object? data = null, DateTimeOffset? timestamp = null)
    Parameters
    Type Name Description
    string type

    The type of the side effect.

    string description

    Human-readable description.

    object data

    Optional associated data. When the payload type declares SideEffectDataContractAttribute, the side effect contract metadata is populated automatically.

    DateTimeOffset? timestamp

    Optional timestamp override. Defaults to current UTC time.

    Returns
    Type Description
    SideEffect
    | Edit this page View Source

    Critical<TData>(string, string, TData, DateTimeOffset?)

    Creates a new critical SideEffect instance with a typed payload contract.

    Declaration
    public static SideEffect Critical<TData>(string type, string description, TData data, DateTimeOffset? timestamp = null)
    Parameters
    Type Name Description
    string type

    The type of the side effect.

    string description

    Human-readable description.

    TData data

    Typed associated payload.

    DateTimeOffset? timestamp

    Optional timestamp override. Defaults to current UTC time.

    Returns
    Type Description
    SideEffect
    Type Parameters
    Name Description
    TData

    The payload type.

    | Edit this page View Source

    TryGetData<TData>(out TData?)

    Attempts to read the side effect payload as a typed contract.

    Declaration
    public bool TryGetData<TData>(out TData? data)
    Parameters
    Type Name Description
    TData data

    The typed payload when available.

    Returns
    Type Description
    bool

    true when the payload is available as TData.

    Type Parameters
    Name Description
    TData

    The expected payload type.

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