Soenneker.SmartEnum.Abbreviated 2.1.84

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.SmartEnum.Abbreviated --version 2.1.84
NuGet\Install-Package Soenneker.SmartEnum.Abbreviated -Version 2.1.84
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="2.1.84" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Soenneker.SmartEnum.Abbreviated --version 2.1.84
#r "nuget: Soenneker.SmartEnum.Abbreviated, 2.1.84"
#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.
// Install Soenneker.SmartEnum.Abbreviated as a Cake Addin
#addin nuget:?package=Soenneker.SmartEnum.Abbreviated&version=2.1.84

// Install Soenneker.SmartEnum.Abbreviated as a Cake Tool
#tool nuget:?package=Soenneker.SmartEnum.Abbreviated&version=2.1.84

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 abbrevations

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 Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.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
2.1.163 0 6/1/2024
2.1.162 8 6/1/2024
2.1.161 24 6/1/2024
2.1.160 19 6/1/2024
2.1.159 35 6/1/2024
2.1.158 43 5/31/2024
2.1.157 39 5/31/2024
2.1.156 66 5/31/2024
2.1.155 38 5/31/2024
2.1.154 41 5/31/2024
2.1.153 74 5/29/2024
2.1.152 41 5/29/2024
2.1.151 46 5/29/2024
2.1.150 40 5/29/2024
2.1.149 37 5/29/2024
2.1.148 94 5/28/2024
2.1.147 44 5/28/2024
2.1.146 55 5/28/2024
2.1.145 42 5/28/2024
2.1.144 69 5/28/2024
2.1.143 47 5/28/2024
2.1.142 53 5/27/2024
2.1.141 49 5/27/2024
2.1.140 67 5/27/2024
2.1.139 74 5/27/2024
2.1.138 74 5/27/2024
2.1.137 57 5/27/2024
2.1.136 62 5/26/2024
2.1.135 95 5/26/2024
2.1.134 70 5/26/2024
2.1.133 69 5/26/2024
2.1.132 78 5/26/2024
2.1.131 80 5/26/2024
2.1.130 69 5/26/2024
2.1.129 66 5/26/2024
2.1.128 82 5/25/2024
2.1.127 63 5/25/2024
2.1.126 79 5/25/2024
2.1.125 66 5/25/2024
2.1.124 66 5/25/2024
2.1.123 62 5/25/2024
2.1.122 89 5/25/2024
2.1.121 68 5/25/2024
2.1.120 76 5/25/2024
2.1.119 68 5/25/2024
2.1.118 92 5/25/2024
2.1.117 97 5/23/2024
2.1.116 67 5/23/2024
2.1.115 70 5/23/2024
2.1.114 62 5/23/2024
2.1.113 86 5/23/2024
2.1.112 68 5/23/2024
2.1.111 69 5/23/2024
2.1.110 92 5/23/2024
2.1.109 66 5/23/2024
2.1.108 84 5/22/2024
2.1.107 66 5/22/2024
2.1.106 85 5/22/2024
2.1.105 67 5/22/2024
2.1.104 80 5/22/2024
2.1.103 64 5/22/2024
2.1.102 64 5/22/2024
2.1.101 80 5/22/2024
2.1.100 90 5/18/2024
2.1.99 81 5/18/2024
2.1.98 91 5/18/2024
2.1.97 72 5/18/2024
2.1.96 80 5/18/2024
2.1.95 79 5/18/2024
2.1.94 99 5/17/2024
2.1.93 89 5/17/2024
2.1.92 98 5/17/2024
2.1.91 79 5/17/2024
2.1.90 89 5/17/2024
2.1.89 84 5/17/2024
2.1.88 115 5/16/2024
2.1.87 86 5/16/2024
2.1.86 80 5/16/2024
2.1.85 90 5/15/2024
2.1.84 80 5/15/2024
2.1.83 88 5/15/2024
2.1.82 102 5/15/2024
2.1.81 77 5/15/2024
2.1.80 97 5/13/2024
2.1.79 71 5/13/2024
2.1.78 70 5/13/2024
2.1.77 70 5/13/2024
2.1.76 135 4/30/2024
2.1.75 92 4/30/2024
2.1.74 88 4/30/2024
2.1.73 80 4/30/2024
2.1.72 96 4/30/2024
2.1.71 73 4/29/2024
2.1.70 74 4/29/2024
2.1.69 94 4/29/2024
2.1.68 75 4/29/2024
2.1.67 72 4/29/2024
2.1.66 76 4/29/2024
2.1.65 75 4/28/2024
2.1.64 67 4/28/2024
2.1.63 84 4/28/2024
2.1.62 67 4/28/2024
2.1.61 82 4/28/2024
2.1.60 81 4/28/2024
2.1.59 92 4/28/2024
2.1.58 64 4/28/2024
2.1.57 80 4/28/2024
2.1.56 68 4/28/2024
2.1.55 83 4/28/2024
2.1.54 68 4/28/2024
2.1.53 83 4/28/2024
2.1.52 72 4/28/2024
2.1.51 78 4/27/2024
2.1.50 174 4/20/2024
2.1.49 89 4/20/2024
2.1.48 94 4/19/2024
2.1.47 72 4/19/2024
2.1.46 76 4/19/2024
2.1.45 69 4/19/2024
2.1.44 88 4/19/2024
2.1.43 90 4/19/2024
2.1.42 77 4/19/2024
2.1.41 85 4/18/2024
2.1.40 137 4/13/2024
2.1.39 89 4/13/2024
2.1.38 81 4/13/2024
2.1.37 85 4/13/2024
2.1.36 55 4/13/2024
2.1.35 89 4/12/2024
2.1.34 81 4/12/2024
2.1.33 67 4/12/2024
2.1.32 91 4/12/2024
2.1.31 74 4/12/2024
2.1.30 87 4/12/2024
2.1.29 67 4/12/2024
2.1.28 104 4/12/2024
2.1.27 62 4/12/2024
2.1.26 85 4/12/2024
2.1.25 76 4/12/2024
2.1.24 80 4/12/2024
2.1.23 87 4/11/2024
2.1.22 76 4/11/2024
2.1.21 102 4/10/2024
2.1.20 82 4/10/2024
2.1.19 71 4/10/2024
2.1.18 85 4/10/2024
2.1.17 75 4/10/2024
2.1.16 81 4/10/2024
2.1.15 60 4/10/2024
2.1.14 229 4/3/2024
2.1.13 76 4/2/2024
2.1.12 69 4/2/2024
2.1.11 65 4/2/2024
2.1.10 68 4/2/2024
2.1.9 53 4/2/2024
2.1.8 69 4/1/2024
2.1.7 68 4/1/2024
2.1.6 62 4/1/2024
2.1.5 78 3/31/2024
2.1.4 78 3/30/2024
2.1.3 72 3/30/2024
2.1.2 79 3/27/2024