Table of Contents

Class ValidationResult

Namespace
Arbiter.CommandQuery.Models
Assembly
Arbiter.CommandQuery.dll

A class that represents the result of a validation.

public class ValidationResult
Inheritance
ValidationResult
Inherited Members

Properties

Errors

Gets or sets the validation errors. The dictionary key is the property name, and the value is an array of error messages.

[JsonPropertyName("errors")]
public IDictionary<string, string[]> Errors { get; set; }

Property Value

IDictionary<string, string[]>

IsValid

Gets or sets whether the validation was successful.

[JsonPropertyName("isValid")]
public bool IsValid { get; }

Property Value

bool

Success

Gets a ValidationResult instance that represents a successful validation result.

public static ValidationResult Success { get; }

Property Value

ValidationResult

Remarks

This property provides a predefined instance of ValidationResult to represent success, avoiding the need to create a new instance for successful validation scenarios.

Methods

ToString()

Generates a string representation of the error messages separated by new lines.

public override string ToString()

Returns

string

A string representation of the error message

ToString(string)

Generates a string representation of the error messages separated by the specified character.

public string ToString(string separator)

Parameters

separator string

The character to separate the error messages.

Returns

string

A string representation of the error message