Class ApiMessageFormatter
- Namespace
- Visus.AddressValidation.Validation
- Assembly
- Visus.AddressValidation.dll
Formats a provider-supplied code and message into a ValidationState.
public static class ApiMessageFormatter
- Inheritance
-
ApiMessageFormatter
- Inherited Members
Methods
CreateError(string?, string?)
Creates an error state from a provider error code and message.
public static ValidationState CreateError(string? code, string? message)
Parameters
codestringThe provider's error code. Can be null, empty, or consist only of whitespace when the provider omits one.
messagestringThe provider's error message. Can be null, empty, or consist only of whitespace when the provider omits one.
Returns
- ValidationState
A ValidationState instance.
Exceptions
- ArgumentException
Thrown when
codeandmessageare both null, empty, or whitespace.
CreateWarning(string?, string?)
Creates a warning state from a provider code and message.
public static ValidationState CreateWarning(string? code, string? message)
Parameters
codestringThe provider's code. Can be null, empty, or consist only of whitespace when the provider omits one.
messagestringThe provider's message. Can be null, empty, or consist only of whitespace when the provider omits one.
Returns
- ValidationState
A ValidationState instance.
Exceptions
- ArgumentException
Thrown when
codeandmessageare both null, empty, or whitespace.