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
errorsIDictionary<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
Returns
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
resultValidationResult