Soenneker.Enums.CountryType
11.0.1017
Prefix Reserved
dotnet add package Soenneker.Enums.CountryType --version 11.0.1017
NuGet\Install-Package Soenneker.Enums.CountryType -Version 11.0.1017
<PackageReference Include="Soenneker.Enums.CountryType" Version="11.0.1017" />
<PackageVersion Include="Soenneker.Enums.CountryType" Version="11.0.1017" />
<PackageReference Include="Soenneker.Enums.CountryType" />
paket add Soenneker.Enums.CountryType --version 11.0.1017
#r "nuget: Soenneker.Enums.CountryType, 11.0.1017"
#:package Soenneker.Enums.CountryType@11.0.1017
#addin nuget:?package=Soenneker.Enums.CountryType&version=11.0.1017
#tool nuget:?package=Soenneker.Enums.CountryType&version=11.0.1017
Soenneker.Enums.CountryType
A smart enum of countries and territories with stable numeric values, ISO 3166-1 alpha-2 abbreviations, and CLDR-style display names.
Installation
dotnet add package Soenneker.Enums.CountryType
Usage
using Soenneker.Enums.CountryType;
CountryType country = CountryType.UnitedStates;
string name = country.Name; // "UnitedStates"
int value = country.Value; // 235
string code = country.Abbreviation; // "US"
string displayName = country.Description; // "United States"
Look up a country by its two-letter code:
CountryType canada = CountryType.FromAbbreviation("CA");
if (CountryType.TryFromAbbreviation(input, ignoreCase: true, out CountryType? country))
{
Console.WriteLine(country.Description);
}
FromAbbreviation throws when the code is unknown. Use TryFromAbbreviation for user or external input.
The inherited smart-enum APIs are also available for names and numeric values:
CountryType germany = CountryType.FromName("Germany");
CountryType france = CountryType.FromValue(76);
foreach (CountryType option in CountryType.List)
{
Console.WriteLine($"{option.Abbreviation}: {option.Description}");
}
Name is the C# identifier used by the enum entry, while Description is intended for display. They differ for entries such as UnitedStates / United States; use Abbreviation when exchanging ISO country codes.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Soenneker.SmartEnum.AbbreviatedDescriptive (>= 11.0.1042)
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.1017 | 220 | 11/3/2026 |
| 11.0.1016 | 104 | 11/3/2026 |
| 11.0.1015 | 315 | 10/27/2026 |
| 11.0.1014 | 97 | 10/27/2026 |
| 11.0.1013 | 100 | 10/27/2026 |
| 11.0.1012 | 136 | 10/27/2026 |
| 11.0.1011 | 105 | 10/26/2026 |
| 11.0.1009 | 105 | 10/26/2026 |
| 11.0.1008 | 101 | 10/26/2026 |
| 11.0.1007 | 101 | 10/26/2026 |
| 4.0.1006 | 196 | 10/15/2026 |
| 4.0.1005 | 104 | 10/15/2026 |
| 4.0.1004 | 102 | 10/14/2026 |
| 4.0.1003 | 106 | 10/14/2026 |
| 4.0.1002 | 97 | 10/14/2026 |
| 4.0.1000 | 115 | 10/14/2026 |
| 4.0.995 | 104 | 10/13/2026 |
| 4.0.994 | 108 | 10/12/2026 |
| 4.0.993 | 105 | 10/12/2026 |
| 4.0.992 | 110 | 10/12/2026 |
Updated Multiple NuGet packages