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

    Show / Hide Table of Contents

    Class MutationHistory

    Represents the full mutation history of a specific state object.

    Inheritance
    object
    MutationHistory
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: ModularityKit.Mutator.Abstractions.History
    Assembly: ModularityKit.Mutator.dll
    Syntax
    public sealed class MutationHistory
    Remarks

    MutationHistory stores a chronological sequence of MutationHistoryEntry entries. It allows replaying state changes, querying timelines for specific paths, and computing statistics. This is typically used in combination with IMutationHistoryStore to persist and retrieve histories.

    Properties

    | Edit this page View Source

    Entries

    Chronological list of mutation entries.

    Declaration
    public IReadOnlyList<MutationHistoryEntry> Entries { get; init; }
    Property Value
    Type Description
    IReadOnlyList<MutationHistoryEntry>
    | Edit this page View Source

    FirstMutationAt

    Timestamp of the first mutation in the history.

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

    LastMutationAt

    Timestamp of the last mutation in the history.

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

    StateId

    Unique identifier of the state object.

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

    StateType

    Type of the state object.

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

    TotalMutations

    Total number of mutations recorded.

    Declaration
    public int TotalMutations { get; }
    Property Value
    Type Description
    int

    Methods

    | Edit this page View Source

    GetStatistics()

    Computes summary statistics of the mutation history.

    Declaration
    public HistoryStatistics GetStatistics()
    Returns
    Type Description
    HistoryStatistics

    A HistoryStatistics instance containing totals, averages, and mutation distribution.

    | Edit this page View Source

    GetTimelineForPath(string)

    Retrieves a timeline of changes for a specific property path.

    Declaration
    public IEnumerable<StateChangeTimeline> GetTimelineForPath(string path)
    Parameters
    Type Name Description
    string path

    The property path (e.g., "Email" or "Address.City").

    Returns
    Type Description
    IEnumerable<StateChangeTimeline>

    A chronological sequence of StateChangeTimeline entries for that path.

    | Edit this page View Source

    ReplayUntil<TState>(TState, DateTimeOffset, Func<TState, ChangeSet, TState>)

    Replays the mutation history up to a specific timestamp.

    Declaration
    public TState ReplayUntil<TState>(TState initialState, DateTimeOffset timestamp, Func<TState, ChangeSet, TState> applyChanges)
    Parameters
    Type Name Description
    TState initialState

    The initial state before any mutations.

    DateTimeOffset timestamp

    Replay mutations only up to this timestamp (inclusive).

    Func<TState, ChangeSet, TState> applyChanges

    Function that applies a ChangeSet to a state instance.

    Returns
    Type Description
    TState

    The reconstructed state as of the given timestamp.

    Type Parameters
    Name Description
    TState

    Type of the state object.

    | Edit this page View Source

    Replay<TState>(TState, Func<TState, ChangeSet, TState>)

    Replays the full mutation history to reconstruct the current state.

    Declaration
    public TState Replay<TState>(TState initialState, Func<TState, ChangeSet, TState> applyChanges)
    Parameters
    Type Name Description
    TState initialState

    The initial state before any mutations.

    Func<TState, ChangeSet, TState> applyChanges

    Function that applies a ChangeSet to a state instance.

    Returns
    Type Description
    TState

    The reconstructed state after applying all mutations.

    Type Parameters
    Name Description
    TState

    Type of the state object.

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