Table of Contents

Class AddressValidationResult

Namespace
SEBT.Portal.Core.Services
Assembly
SEBT.Portal.Core.dll

Result of an address validation call.

public record AddressValidationResult
Inheritance
object
AddressValidationResult

Constructors

AddressValidationResult(bool, Address?, Address?, string?, string?)

Result of an address validation call.

public AddressValidationResult(bool IsValid, Address? NormalizedAddress = null, Address? SuggestedAddress = null, string? ErrorMessage = null, string? Reason = null)

Parameters

IsValid bool

Whether the address passed validation.

NormalizedAddress Address

USPS-normalized address when valid, if available.

SuggestedAddress Address

An alternative address suggested by the validation service, if any.

ErrorMessage string

A user-facing error message if validation failed.

Reason string

The specific reason for the validation outcome (e.g., "blocked", "too_long", "abbreviated").

Properties

ErrorMessage

A user-facing error message if validation failed.

public string? ErrorMessage { get; init; }

Property Value

string

IsValid

Whether the address passed validation.

public bool IsValid { get; init; }

Property Value

bool

NormalizedAddress

USPS-normalized address when valid, if available.

public Address? NormalizedAddress { get; init; }

Property Value

Address

Reason

The specific reason for the validation outcome (e.g., "blocked", "too_long", "abbreviated").

public string? Reason { get; init; }

Property Value

string

SuggestedAddress

An alternative address suggested by the validation service, if any.

public Address? SuggestedAddress { get; init; }

Property Value

Address

Methods

Invalid(string, string)

public static AddressValidationResult Invalid(string errorMessage, string reason)

Parameters

errorMessage string
reason string

Returns

AddressValidationResult

Suggestion(Address, string)

public static AddressValidationResult Suggestion(Address suggested, string reason)

Parameters

suggested Address
reason string

Returns

AddressValidationResult

Valid(Address?)

public static AddressValidationResult Valid(Address? normalizedAddress = null)

Parameters

normalizedAddress Address

Returns

AddressValidationResult