Struct ValidationResult<T>
- Namespace
- Veritas
- Assembly
- Veritas.dll
Represents the outcome of validating an identifier.
public readonly struct ValidationResult<T>
Type Parameters
TStrongly typed value when validation succeeds.
- Inherited Members
Constructors
ValidationResult(bool, T?, ValidationError, string?)
Initializes a new instance of the ValidationResult<T> struct.
public ValidationResult(bool isValid, T? value, ValidationError error, string? message = null)
Parameters
isValidboolIndicates whether the input was valid.
valueTThe parsed value when validation succeeds.
errorValidationErrorThe error classification.
messagestringOptional human-readable message.
Properties
Error
Gets the classification of any validation error.
public ValidationError Error { get; }
Property Value
IsValid
Gets a value indicating whether the input was valid.
public bool IsValid { get; }
Property Value
Message
Gets an optional message describing the validation result.
public string? Message { get; }
Property Value
Value
Gets the parsed value when IsValid is true.
public T? Value { get; }
Property Value
- T