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

Updated Multiple NuGet packages