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
                    
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.Enums.StateType" Version="11.0.1028" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Enums.StateType" Version="11.0.1028" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Enums.StateType" />
                    
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.Enums.StateType --version 11.0.1028
                    
#r "nuget: Soenneker.Enums.StateType, 11.0.1028"
                    
#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.Enums.StateType@11.0.1028
                    
#: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.Enums.StateType&version=11.0.1028
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Enums.StateType&version=11.0.1028
                    
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.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 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.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
Loading failed

Update dependency Soenneker.SmartEnum.AbbreviatedDescriptive to 11.0.1055 (#1627)