VOOZH about

URL: https://www.nuget.org/packages/Soenneker.SmartEnum.Abbreviated/

⇱ NuGet Gallery | Soenneker.SmartEnum.Abbreviated 4.0.1342




👁 Image
Soenneker.SmartEnum.Abbreviated 4.0.1342

Prefix Reserved
dotnet add package Soenneker.SmartEnum.Abbreviated --version 4.0.1342
 
 
NuGet\Install-Package Soenneker.SmartEnum.Abbreviated -Version 4.0.1342
 
 
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.SmartEnum.Abbreviated" Version="4.0.1342" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.SmartEnum.Abbreviated" Version="4.0.1342" />
 
Directory.Packages.props
<PackageReference Include="Soenneker.SmartEnum.Abbreviated" />
 
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.SmartEnum.Abbreviated --version 4.0.1342
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Soenneker.SmartEnum.Abbreviated, 4.0.1342"
 
 
#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.SmartEnum.Abbreviated@4.0.1342
 
 
#: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.SmartEnum.Abbreviated&version=4.0.1342
 
Install as a Cake Addin
#tool nuget:?package=Soenneker.SmartEnum.Abbreviated&version=4.0.1342
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

👁 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

👁 alternate text is missing from this package README image
Soenneker.SmartEnum.Abbreviated

A derivative of Ardalis' SmartEnum, adding support for abbreviations

Installation

dotnet add package Soenneker.SmartEnum.Abbreviated

Usage

The AbbreviatedSmartEnum class is an abstract base class that extends the SmartEnum class from Ardalis' library. It provides additional functionality for working with abbreviated enum values.

To create an abbreviated SmartEnum, you need to derive a new class from AbbreviatedSmartEnum<TEnum>.

public class LanguageType : AbbreviatedSmartEnum<LanguageType>
{
 public static readonly LanguageType English = new(nameof(English), 1, "EN");
 public static readonly LanguageType Spanish = new(nameof(Spanish), 2, "ES");
 public static readonly LanguageType French = new(nameof(French), 3, "FR");

 private LanguageType(string name, int value, string abbreviation)
 : base(name, value, abbreviation)
 {
 }
}

and how you use your new SmartEnum:

string abbreviated = LanguageType.English.Abbreviation; // "EN"

// Get the enum value for the "EN" abbreviation
LanguageType english = LanguageType.FromAbbreviation("EN");

// Try to get the enum value for the "ES" abbreviation (case-insensitive)
if (LanguageType.TryFromAbbreviation("es", ignoreCase: true, out LanguageType spanish))
{
 // spanish will be the LanguageType.Spanish value
}

The IgnoreCase and StaticIgnoreCase properties allow you to control whether the abbreviation matching is case-sensitive or case-insensitive, either for a specific instance or globally across all instances of the derived enum class.

Product Versions Compatible and additional computed target framework versions.
.NET net10.0 net10.0 is compatible.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows 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 (2)

Showing the top 2 NuGet packages that depend on Soenneker.SmartEnum.Abbreviated:

Package Downloads
Soenneker.SmartEnum.AbbreviatedDescriptive

A derivative of AbbreviatedSmartEnum adding support for descriptions

Soenneker.Json.Converters.AbbreviatedSmartEnum

A System.Text.Json AbbreviatedSmartEnum converter

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.1342 88 6/16/2026
4.0.1341 87 6/16/2026
4.0.1340 250 6/10/2026
4.0.1339 168 6/9/2026
4.0.1338 187 6/9/2026
4.0.1337 206 6/6/2026
4.0.1336 168 6/6/2026
4.0.1335 119 6/6/2026
4.0.1334 147 6/6/2026
4.0.1333 113 6/5/2026
4.0.1331 166 6/5/2026
4.0.1329 487 5/13/2026
4.0.1328 547 5/2/2026
4.0.1327 348 4/23/2026
4.0.1326 163 4/23/2026
4.0.1324 162 4/23/2026
4.0.1323 108 4/23/2026
4.0.1322 161 4/22/2026
4.0.1321 152 4/22/2026
4.0.1320 135 4/22/2026
Loading failed

Update dependency Soenneker.Extensions.String to 4.0.690 (#1775)