Soenneker.Enums.CountryType 4.0.1002

Prefix Reserved
dotnet add package Soenneker.Enums.CountryType --version 4.0.1002
                    
NuGet\Install-Package Soenneker.Enums.CountryType -Version 4.0.1002
                    
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="4.0.1002" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Enums.CountryType" Version="4.0.1002" />
                    
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 4.0.1002
                    
#r "nuget: Soenneker.Enums.CountryType, 4.0.1002"
                    
#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@4.0.1002
                    
#: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=4.0.1002
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Enums.CountryType&version=4.0.1002
                    
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 net10.0 is compatible.  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. 
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
4.0.1002 0 10/14/2026
4.0.1000 0 10/14/2026
4.0.995 34 10/13/2026
4.0.994 47 10/12/2026
4.0.993 49 10/12/2026
4.0.992 55 10/12/2026
4.0.991 49 10/12/2026
4.0.990 53 10/12/2026
4.0.989 52 10/11/2026
4.0.988 58 10/11/2026
4.0.987 59 10/11/2026
4.0.986 111 10/6/2026
4.0.985 82 10/6/2026
4.0.984 116 9/30/2026
4.0.983 115 9/26/2026
4.0.982 96 9/25/2026
4.0.981 97 9/24/2026
4.0.980 110 9/16/2026
4.0.979 98 9/16/2026
4.0.978 100 9/15/2026
Loading failed

Update dependency dotnet-sdk to v10.0.402 (#1595)