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

    Show / Hide Table of Contents

    Class ValidationError

    Represents a validation error encountered during mutation or state validation. Contains information about the invalid field, the error message, and optional metadata.

    Inheritance
    object
    ValidationError
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: ModularityKit.Mutator.Abstractions.Results
    Assembly: ModularityKit.Mutator.dll
    Syntax
    public sealed class ValidationError

    Constructors

    | Edit this page View Source

    ValidationError(string, string, string?)

    Constructs a new ValidationError instance with an error code.

    Declaration
    public ValidationError(string path, string message, string? code = null)
    Parameters
    Type Name Description
    string path

    Path to the invalid property or field.

    string message

    Description of the validation error.

    string code

    Error code for categorization or localization.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if path or message is null.

    Properties

    | Edit this page View Source

    AttemptedValue

    The value that triggered the validation error, if applicable. Useful for diagnostics and debugging.

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

    Code

    Optional error code, useful for categorization or localization (i18n).

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

    Message

    Human-readable description of the error. Should clearly explain why the value is invalid.

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

    Path

    Path to the property or field that caused the validation error. Examples: "Email", "Address.City", "Wallet.Owners[0].Role".

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

    Methods

    | Edit this page View Source

    ToString()

    Returns a string representation of the validation error, including severity, path, and message.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string
    Overrides
    object.ToString()
    • Edit this page
    • View Source
    In this article
    ModularityKit.Mutator Generated from XML docs and published from main. Back to top