Table of Contents

Struct ValidationError.FieldError

Namespace
FunctionalDdd
Assembly
FunctionalDdd.RailwayOrientedProgramming.dll

Represents an error for a specific field, which may have multiple detail messages.

public readonly record struct ValidationError.FieldError : IEquatable<ValidationError.FieldError>
Implements
Inherited Members
Extension Methods

Constructors

FieldError(string, IEnumerable<string>)

Creates a field error with the specified name and error messages.

public FieldError(string fieldName, IEnumerable<string> details)

Parameters

fieldName string

Name of the field.

details IEnumerable<string>

One or more error messages for this field.

Exceptions

ArgumentException

Thrown when no detail messages are provided.

FieldError(string, ImmutableArray<string>)

Represents an error for a specific field, which may have multiple detail messages.

public FieldError(string FieldName, ImmutableArray<string> Details)

Parameters

FieldName string

Name of the field that failed validation.

Details ImmutableArray<string>

Collection of validation error messages for this field.

Properties

Details

Collection of validation error messages for this field.

public ImmutableArray<string> Details { get; init; }

Property Value

ImmutableArray<string>

FieldName

Name of the field that failed validation.

public string FieldName { get; init; }

Property Value

string

Methods

ToString()

Returns a string representation of this field error showing the field name and all detail messages.

public override string ToString()

Returns

string

A formatted string in the form "FieldName: detail1, detail2, ..."