Table of Contents

Class RequestValidationException

Namespace
Integrations.Application.Common
Assembly
Integrations.Application.dll

Request failed validation. Errors maps field names to messages.

public sealed class RequestValidationException : IntegrationException, ISerializable
Inheritance
RequestValidationException
Implements
Inherited Members

Constructors

RequestValidationException(IDictionary<string, string[]>)

Request failed validation. Errors maps field names to messages.

public RequestValidationException(IDictionary<string, string[]> errors)

Parameters

errors IDictionary<string, string[]>

Properties

Errors

Messages per field (camelCase JSON paths).

public IDictionary<string, string[]> Errors { get; }

Property Value

IDictionary<string, string[]>

Methods

For(string, string)

Validation failure for a single field.

public static RequestValidationException For(string field, string message)

Parameters

field string
message string

Returns

RequestValidationException

From(ValidationResult)

From a FluentValidation result, with field paths in the same camelCase as the JSON the caller sent (Lines[0].JobSite.Country becomes lines[0].jobSite.country), so clients can map errors to fields.

public static RequestValidationException From(ValidationResult result)

Parameters

result ValidationResult

Returns

RequestValidationException