Soenneker.Enums.StateType
11.0.1028
Prefix Reserved
dotnet add package Soenneker.Enums.StateType --version 11.0.1028
NuGet\Install-Package Soenneker.Enums.StateType -Version 11.0.1028
<PackageReference Include="Soenneker.Enums.StateType" Version="11.0.1028" />
<PackageVersion Include="Soenneker.Enums.StateType" Version="11.0.1028" />
<PackageReference Include="Soenneker.Enums.StateType" />
paket add Soenneker.Enums.StateType --version 11.0.1028
#r "nuget: Soenneker.Enums.StateType, 11.0.1028"
#:package Soenneker.Enums.StateType@11.0.1028
#addin nuget:?package=Soenneker.Enums.StateType&version=11.0.1028
#tool nuget:?package=Soenneker.Enums.StateType&version=11.0.1028
Soenneker.Enums.StateType
A smart enum for the 50 U.S. states, the District of Columbia, and Puerto Rico, with postal abbreviations and display names.
Install
dotnet add package Soenneker.Enums.StateType
Usage
using Soenneker.Enums.StateType;
StateType state = StateType.NewYork;
string name = state.Name; // "NewYork"
int value = state.Value; // 32
string abbreviation = state.Abbreviation; // "NY"
string displayName = state.Description; // "New York"
Look up a value by postal abbreviation:
StateType texas = StateType.FromAbbreviation("TX");
if (StateType.TryFromAbbreviation(input, ignoreCase: true, out StateType? parsed))
{
Console.WriteLine(parsed.Description);
}
Abbreviation lookup is case-insensitive for this type. FromAbbreviation throws when no value matches; use TryFromAbbreviation for user input.
The inherited smart-enum APIs also support names, numeric values, and enumeration:
StateType district = StateType.FromName("DistrictOfColumbia");
StateType puertoRico = StateType.FromValue(39);
foreach (StateType option in StateType.List)
Console.WriteLine($"{option.Abbreviation}: {option.Description}");
Use Abbreviation for postal and external contracts. The numeric Value is a package identifier, not a postal or FIPS code.
The set includes DC and Puerto Rico but not other U.S. territories, military postal regions, or freely associated states. It identifies a region only; it does not validate an address, ZIP code, state/ZIP relationship, or deliverability.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Soenneker.SmartEnum.AbbreviatedDescriptive (>= 11.0.1055)
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.1028 | 26 | 11/25/2026 |
| 11.0.1027 | 87 | 11/18/2026 |
| 11.0.1025 | 97 | 11/15/2026 |
| 11.0.1024 | 120 | 11/11/2026 |
| 11.0.1023 | 96 | 11/11/2026 |
| 11.0.1022 | 97 | 11/11/2026 |
| 11.0.1021 | 91 | 11/11/2026 |
| 11.0.1020 | 93 | 11/11/2026 |
| 11.0.1019 | 95 | 11/11/2026 |
| 11.0.1018 | 183 | 11/3/2026 |
| 11.0.1017 | 103 | 11/2/2026 |
| 11.0.1016 | 121 | 10/27/2026 |
| 11.0.1015 | 97 | 10/27/2026 |
| 11.0.1014 | 102 | 10/27/2026 |
| 11.0.1013 | 101 | 10/27/2026 |
| 11.0.1012 | 105 | 10/27/2026 |
| 11.0.1011 | 103 | 10/26/2026 |
| 11.0.1010 | 96 | 10/26/2026 |
| 11.0.1009 | 106 | 10/26/2026 |
| 11.0.1008 | 95 | 10/26/2026 |
Update dependency Soenneker.SmartEnum.AbbreviatedDescriptive to 11.0.1055 (#1627)