Skip to content

ValidationResult ​

Namespace: Hex1b.Widgets

Assembly: Hex1b.dll

Represents the result of a field validation.

csharp
public sealed record ValidationResult : IEquatable<ValidationResult>

Inheritance ​

Object → ValidationResult

Implements ​

Properties ​

ErrorMessage ​

The error message if validation failed, or null if valid.

Returns: String

csharp
public string? ErrorMessage { get; }

IsValid ​

Whether the field value is valid.

Returns: Boolean

csharp
public bool IsValid { get; }

Methods ​

Error(string) ​

Creates a failed validation result with the specified error message.

Parameters:

Returns: ValidationResult

csharp
public static ValidationResult Error(string message)

Fields ​

Valid ​

A successful validation result with no error.

Returns: ValidationResult

csharp
public static readonly ValidationResult Valid

Released under the MIT License.