ISOCodex.Addressing
1.0.0-alpha.1
See the version list below for details.
dotnet add package ISOCodex.Addressing --version 1.0.0-alpha.1
NuGet\Install-Package ISOCodex.Addressing -Version 1.0.0-alpha.1
<PackageReference Include="ISOCodex.Addressing" Version="1.0.0-alpha.1" />
<PackageVersion Include="ISOCodex.Addressing" Version="1.0.0-alpha.1" />
<PackageReference Include="ISOCodex.Addressing" />
paket add ISOCodex.Addressing --version 1.0.0-alpha.1
#r "nuget: ISOCodex.Addressing, 1.0.0-alpha.1"
#:package ISOCodex.Addressing@1.0.0-alpha.1
#addin nuget:?package=ISOCodex.Addressing&version=1.0.0-alpha.1&prerelease
#tool nuget:?package=ISOCodex.Addressing&version=1.0.0-alpha.1&prerelease
ISOCodex.Addressing
ISOCodex.Addressing provides a small .NET domain model for postal addresses plus country-specific address validation through a validator factory.
Features
- ISO 3166-1 alpha-2 country code value object
- Lightweight postal code value object
- Address model suitable for application/domain use
- Country-specific validation via
IAddressValidator - DI registration for selected built-in validators
- Built-in support for:
- Great Britain (
GB) - United States (
US) - Canada (
CA)
- Great Britain (
Installation
dotnet add package ISOCodex.Addressing
Core types
AddressCountryCodePostalCodeIAddressValidatorIAddressValidatorFactory
Register validators with DI
using ISOCodex.Addressing;
using ISOCodex.Addressing.Validation;
using Microsoft.Extensions.DependencyInjection;
var services = new ServiceCollection();
services.AddAddressing(
CountryCode.GB,
CountryCode.US,
CountryCode.CA);
using var serviceProvider = services.BuildServiceProvider();
var validatorFactory = serviceProvider.GetRequiredService<IAddressValidatorFactory>();
Validate an address
using ISOCodex.Addressing;
var address = new Address(
line1: "10 Downing Street",
line2: null,
city: "London",
stateOrProvince: null,
postalCode: new PostalCode("SW1A 2AA"),
countryCode: CountryCode.GB);
validatorFactory.GetValidator(address.CountryCode).Validate(address);
Country-specific notes
Great Britain (GB)
- Validates postcode format
- Expects uppercase postcode format with a space, for example
SW1A 1AA
United States (US)
- Validates ZIP or ZIP+4
- Requires
StateOrProvince - Accepts US state and territory abbreviations
Canada (CA)
- Validates postal code format such as
A1A 1A1 - Province/territory is optional
- If provided, province/territory must be a valid abbreviation
Extension packages
Country support can be extended through additional packages. Spain support is provided by the separate ISOCodex.Addressing.Spain project in the repository rather than by this core package.
Important behaviour
PostalCodeitself does not enforce country-specific formatting- Validation is performed by the country validator
- Validators normalize common postal-code casing and spacing for validation without changing the stored
PostalCode.Code AddAddressing(...)only registers the validators you explicitly request
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- Microsoft.Extensions.DependencyInjection (>= 9.0.4)
NuGet packages (12)
Showing the top 5 NuGet packages that depend on ISOCodex.Addressing:
| Package | Downloads |
|---|---|
|
ISOCodex.Addressing.Spain
Spain-specific extension package for ISOCodex.Addressing. |
|
|
ISOCodex.Addressing.Ireland
Ireland-specific extension package for ISOCodex.Addressing. |
|
|
ISOCodex.Addressing.France
France-specific extension package for ISOCodex.Addressing. |
|
|
ISOCodex.Currency.Addressing
Address and currency validation helpers for ISOCodex.Currency and ISOCodex.Addressing. |
|
|
ISOCodex.Addressing.Canada
Canada-specific extension package for ISOCodex.Addressing. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.1 | 499 | 6/23/2026 |
| 2.0.0 | 567 | 6/23/2026 |
| 2.0.0-alpha | 465 | 6/20/2026 |
| 1.3.0 | 634 | 6/20/2026 |
| 1.2.0 | 327 | 6/14/2026 |
| 1.1.0 | 224 | 6/14/2026 |
| 1.0.0 | 139 | 6/14/2026 |
| 1.0.0-alpha.4 | 72 | 6/14/2026 |
| 1.0.0-alpha.3 | 64 | 6/13/2026 |
| 1.0.0-alpha.2 | 67 | 6/13/2026 |
| 1.0.0-alpha.1 | 70 | 6/13/2026 |