Class DomainValidationError
- Namespace
- JD.Domain.Validation
- Assembly
- JD.Domain.Validation.dll
API-friendly representation of a domain validation error.
public sealed record DomainValidationError : IEquatable<DomainValidationError>
- Inheritance
-
DomainValidationError
- Implements
- Inherited Members
Properties
Code
Gets the error code identifying the type of error.
public required string Code { get; init; }
Property Value
Message
Gets the human-readable error message.
public required string Message { get; init; }
Property Value
Metadata
Gets additional metadata as key-value pairs.
public IDictionary<string, object?>? Metadata { get; init; }
Property Value
Severity
Gets the severity level as a string.
public string Severity { get; init; }
Property Value
Target
Gets the target property or path where the error occurred.
public string? Target { get; init; }
Property Value
Methods
FromDomainError(DomainError)
Creates a DomainValidationError from a DomainError.
public static DomainValidationError FromDomainError(DomainError error)
Parameters
errorDomainErrorThe domain error to convert.
Returns
- DomainValidationError
A new DomainValidationError instance.