Soenneker.Validators.ZipCode.Exists 11.0.2724

Prefix Reserved
dotnet add package Soenneker.Validators.ZipCode.Exists --version 11.0.2724
                    
NuGet\Install-Package Soenneker.Validators.ZipCode.Exists -Version 11.0.2724
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soenneker.Validators.ZipCode.Exists" Version="11.0.2724" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Validators.ZipCode.Exists" Version="11.0.2724" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Validators.ZipCode.Exists" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.Validators.ZipCode.Exists --version 11.0.2724
                    
#r "nuget: Soenneker.Validators.ZipCode.Exists, 11.0.2724"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Soenneker.Validators.ZipCode.Exists@11.0.2724
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.Validators.ZipCode.Exists&version=11.0.2724
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Validators.ZipCode.Exists&version=11.0.2724
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Soenneker.Validators.ZipCode.Exists

Validates US ZIP codes against the data snapshot packaged with the library.

Installation

dotnet add package Soenneker.Validators.ZipCode.Exists

Registration

Register the validator as a singleton when the application can share one in-memory ZIP-code set:

using Microsoft.Extensions.DependencyInjection;
using Soenneker.Validators.ZipCode.Exists.Registrars;

services.AddZipCodeExistsValidatorAsSingleton();

A scoped registration is also available:

services.AddZipCodeExistsValidatorAsScoped();

Each scoped instance loads and owns its own cached set. Prefer the singleton registration unless scopes need independent validator instances.

Usage

using Soenneker.Validators.ZipCode.Exists.Abstract;

public sealed class AddressService
{
    private readonly IZipCodeExistsValidator _zipCodeValidator;

    public AddressService(IZipCodeExistsValidator zipCodeValidator)
    {
        _zipCodeValidator = zipCodeValidator;
    }

    public ValueTask<bool> IsKnownZipCode(string zipCode, CancellationToken cancellationToken = default)
    {
        return _zipCodeValidator.Validate(zipCode, cancellationToken);
    }
}
await validator.Validate("00611");       // true when present in the packaged data
await validator.Validate("00611-5353");  // checks "00611"
await validator.Validate("12345");       // false when absent from the packaged data

Behavior

  • Null, empty, and whitespace-only values return false.
  • Values longer than five characters are truncated to their first five characters. This permits ZIP+4 input, but the suffix is not validated.
  • Values of five characters or fewer are matched exactly against the packaged data.
  • The data is loaded lazily on the first validation call and cached for the validator's lifetime.
  • A true result means the five-digit value appears in the package's data snapshot. It does not verify that an address exists or that mail can currently be delivered there.
  • Dispose the validator only when you own it directly. Instances resolved from dependency injection are disposed by the container.
Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
11.0.2724 133 11/11/2026
11.0.2722 91 11/11/2026
11.0.2720 79 11/11/2026
11.0.2719 86 11/11/2026
11.0.2717 77 11/11/2026
11.0.2716 76 11/11/2026
11.0.2714 81 11/11/2026
11.0.2713 82 11/11/2026
11.0.2712 82 11/11/2026
11.0.2711 226 11/3/2026
11.0.2710 91 11/3/2026
11.0.2709 96 11/3/2026
11.0.2708 84 11/3/2026
11.0.2707 86 11/3/2026
11.0.2706 88 11/3/2026
11.0.2705 97 11/2/2026
11.0.2704 117 10/29/2026
11.0.2703 125 10/27/2026
11.0.2702 107 10/27/2026
11.0.2701 96 10/27/2026
Loading failed

Updated Soenneker.Utils.Paths.Resources to 11.0.318