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

    Show / Hide Table of Contents

    Class ValidationResult

    Represents the result of validating a mutation or state change. Contains errors, warnings, and informational messages produced during validation.

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

    Properties

    | Edit this page View Source

    Errors

    Read-only list of validation errors. Each error indicates a violation of rules that prevents the mutation from being applied.

    Declaration
    public IReadOnlyList<ValidationError> Errors { get; }
    Property Value
    Type Description
    IReadOnlyList<ValidationError>
    | Edit this page View Source

    Info

    Read-only list of informational messages produced during validation.

    Declaration
    public IReadOnlyList<ValidationInfo> Info { get; }
    Property Value
    Type Description
    IReadOnlyList<ValidationInfo>
    | Edit this page View Source

    IsValid

    Indicates whether the validation passed successfully. True if there are no errors; false otherwise.

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

    Warnings

    Read-only list of validation warnings. Warnings indicate potential issues that do not block mutation execution.

    Declaration
    public IReadOnlyList<ValidationWarning> Warnings { get; }
    Property Value
    Type Description
    IReadOnlyList<ValidationWarning>

    Methods

    | Edit this page View Source

    AddError(ValidationError)

    Adds an existing ValidationError instance.

    Declaration
    public void AddError(ValidationError error)
    Parameters
    Type Name Description
    ValidationError error

    The error to add.

    | Edit this page View Source

    AddError(string, string, string?)

    Adds a new validation error.

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

    The path or property associated with the error.

    string message

    Human-readable description of the error.

    string code

    Optional error code for categorization.

    | Edit this page View Source

    AddInfo(ValidationInfo)

    Adds an existing ValidationInfo instance.

    Declaration
    public void AddInfo(ValidationInfo info)
    Parameters
    Type Name Description
    ValidationInfo info

    The informational message to add.

    | Edit this page View Source

    AddInfo(string, string)

    Adds an informational validation message.

    Declaration
    public void AddInfo(string path, string message)
    Parameters
    Type Name Description
    string path

    The path or property associated with the info.

    string message

    Human-readable informational message.

    | Edit this page View Source

    AddWarning(ValidationWarning)

    Adds an existing ValidationWarning instance.

    Declaration
    public void AddWarning(ValidationWarning warning)
    Parameters
    Type Name Description
    ValidationWarning warning

    The warning to add.

    | Edit this page View Source

    AddWarning(string, string, string?)

    Adds a new validation warning.

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

    The path or property associated with the warning.

    string message

    Human-readable description of the warning.

    string code

    Optional warning code for categorization.

    | Edit this page View Source

    Success()

    Creates a successful validation result with no errors.

    Declaration
    public static ValidationResult Success()
    Returns
    Type Description
    ValidationResult

    A ValidationResult indicating success.

    | Edit this page View Source

    WithError(string, string, string?)

    Creates a validation result with a single error.

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

    The path or property associated with the error.

    string message

    Human-readable description of the error.

    string code

    Optional error code.

    Returns
    Type Description
    ValidationResult

    A ValidationResult containing one error.

    | Edit this page View Source

    WithErrors(params ValidationError[])

    Creates a validation result containing multiple errors.

    Declaration
    public static ValidationResult WithErrors(params ValidationError[] errors)
    Parameters
    Type Name Description
    ValidationError[] errors

    Array of ValidationError to include.

    Returns
    Type Description
    ValidationResult

    A ValidationResult containing the specified errors.

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