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
fieldNamestringName of the field.
detailsIEnumerable<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
FieldNamestringName of the field that failed validation.
DetailsImmutableArray<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
FieldName
Name of the field that failed validation.
public string FieldName { get; init; }
Property Value
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, ..."