Table of Contents

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

code string

The provider's error code. Can be null, empty, or consist only of whitespace when the provider omits one.

message string

The 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 code and message are 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

code string

The provider's code. Can be null, empty, or consist only of whitespace when the provider omits one.

message string

The 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 code and message are both null, empty, or whitespace.