Table of Contents

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

string

Message

Gets the human-readable error message.

public required string Message { get; init; }

Property Value

string

Metadata

Gets additional metadata as key-value pairs.

public IDictionary<string, object?>? Metadata { get; init; }

Property Value

IDictionary<string, object>

Severity

Gets the severity level as a string.

public string Severity { get; init; }

Property Value

string

Target

Gets the target property or path where the error occurred.

public string? Target { get; init; }

Property Value

string

Methods

FromDomainError(DomainError)

public static DomainValidationError FromDomainError(DomainError error)

Parameters

error DomainError

The domain error to convert.

Returns

DomainValidationError

A new DomainValidationError instance.