Soenneker.SmartEnum.Abbreviated 2.1.183

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.183
NuGet\Install-Package Soenneker.SmartEnum.Abbreviated -Version 2.1.183
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.183" />
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.183
#r "nuget: Soenneker.SmartEnum.Abbreviated, 2.1.183"
#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.183

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

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.189 8 6/27/2024
2.1.188 23 6/27/2024
2.1.187 29 6/27/2024
2.1.186 84 6/22/2024
2.1.185 75 6/22/2024
2.1.184 79 6/22/2024
2.1.183 133 6/16/2024
2.1.182 77 6/15/2024
2.1.181 75 6/15/2024
2.1.180 80 6/15/2024
2.1.179 81 6/15/2024
2.1.178 60 6/15/2024
2.1.177 80 6/15/2024
2.1.176 65 6/15/2024
2.1.175 86 6/15/2024
2.1.174 72 6/15/2024
2.1.173 80 6/14/2024
2.1.172 64 6/14/2024
2.1.171 81 6/14/2024
2.1.170 121 6/4/2024
2.1.169 84 6/4/2024
2.1.168 127 6/2/2024
2.1.167 86 6/1/2024
2.1.166 81 6/1/2024
2.1.165 80 6/1/2024
2.1.164 74 6/1/2024
2.1.163 92 6/1/2024
2.1.162 95 6/1/2024
2.1.161 68 6/1/2024
2.1.160 69 6/1/2024
2.1.159 88 6/1/2024
2.1.158 85 5/31/2024
2.1.157 81 5/31/2024
2.1.156 98 5/31/2024
2.1.155 77 5/31/2024
2.1.154 73 5/31/2024
2.1.153 114 5/29/2024
2.1.152 78 5/29/2024
2.1.151 77 5/29/2024
2.1.150 74 5/29/2024
2.1.149 70 5/29/2024
2.1.148 129 5/28/2024
2.1.147 74 5/28/2024
2.1.146 82 5/28/2024
2.1.145 73 5/28/2024
2.1.144 85 5/28/2024
2.1.143 59 5/28/2024
2.1.142 68 5/27/2024
2.1.141 65 5/27/2024
2.1.140 74 5/27/2024
2.1.139 79 5/27/2024
2.1.138 79 5/27/2024
2.1.137 62 5/27/2024
2.1.136 67 5/26/2024
2.1.135 100 5/26/2024
2.1.134 75 5/26/2024
2.1.133 74 5/26/2024
2.1.132 81 5/26/2024
2.1.131 83 5/26/2024
2.1.130 72 5/26/2024
2.1.129 69 5/26/2024
2.1.128 85 5/25/2024
2.1.127 66 5/25/2024
2.1.126 82 5/25/2024
2.1.125 69 5/25/2024
2.1.124 69 5/25/2024
2.1.123 65 5/25/2024
2.1.122 92 5/25/2024
2.1.121 71 5/25/2024
2.1.120 79 5/25/2024
2.1.119 71 5/25/2024
2.1.118 95 5/25/2024
2.1.117 99 5/23/2024
2.1.116 69 5/23/2024
2.1.115 72 5/23/2024
2.1.114 64 5/23/2024
2.1.113 88 5/23/2024
2.1.112 70 5/23/2024
2.1.111 71 5/23/2024
2.1.110 94 5/23/2024
2.1.109 68 5/23/2024
2.1.108 86 5/22/2024
2.1.107 68 5/22/2024
2.1.106 87 5/22/2024
2.1.105 69 5/22/2024
2.1.104 82 5/22/2024
2.1.103 66 5/22/2024
2.1.102 66 5/22/2024
2.1.101 82 5/22/2024
2.1.100 92 5/18/2024
2.1.99 83 5/18/2024
2.1.98 93 5/18/2024
2.1.97 74 5/18/2024
2.1.96 82 5/18/2024
2.1.95 81 5/18/2024
2.1.94 101 5/17/2024
2.1.93 91 5/17/2024
2.1.92 100 5/17/2024
2.1.91 81 5/17/2024
2.1.90 91 5/17/2024
2.1.89 86 5/17/2024
2.1.88 117 5/16/2024
2.1.87 88 5/16/2024
2.1.86 82 5/16/2024
2.1.85 92 5/15/2024
2.1.84 82 5/15/2024
2.1.83 90 5/15/2024
2.1.82 104 5/15/2024
2.1.81 79 5/15/2024
2.1.80 99 5/13/2024
2.1.79 73 5/13/2024
2.1.78 72 5/13/2024
2.1.77 72 5/13/2024
2.1.76 137 4/30/2024
2.1.75 94 4/30/2024
2.1.74 90 4/30/2024
2.1.73 82 4/30/2024
2.1.72 98 4/30/2024
2.1.71 75 4/29/2024
2.1.70 76 4/29/2024
2.1.69 96 4/29/2024
2.1.68 77 4/29/2024
2.1.67 74 4/29/2024
2.1.66 78 4/29/2024
2.1.65 77 4/28/2024
2.1.64 69 4/28/2024
2.1.63 86 4/28/2024
2.1.62 69 4/28/2024
2.1.61 84 4/28/2024
2.1.60 83 4/28/2024
2.1.59 94 4/28/2024
2.1.58 66 4/28/2024
2.1.57 82 4/28/2024
2.1.56 70 4/28/2024
2.1.55 85 4/28/2024
2.1.54 70 4/28/2024
2.1.53 85 4/28/2024
2.1.52 74 4/28/2024
2.1.51 80 4/27/2024
2.1.50 176 4/20/2024
2.1.49 91 4/20/2024
2.1.48 96 4/19/2024
2.1.47 74 4/19/2024
2.1.46 78 4/19/2024
2.1.45 71 4/19/2024
2.1.44 90 4/19/2024
2.1.43 92 4/19/2024
2.1.42 79 4/19/2024
2.1.41 87 4/18/2024
2.1.40 139 4/13/2024
2.1.39 91 4/13/2024
2.1.38 83 4/13/2024
2.1.37 87 4/13/2024
2.1.36 57 4/13/2024
2.1.35 91 4/12/2024
2.1.34 83 4/12/2024
2.1.33 69 4/12/2024
2.1.32 93 4/12/2024
2.1.31 76 4/12/2024
2.1.30 89 4/12/2024
2.1.29 69 4/12/2024
2.1.28 106 4/12/2024
2.1.27 64 4/12/2024
2.1.26 87 4/12/2024
2.1.25 78 4/12/2024
2.1.24 81 4/12/2024
2.1.23 88 4/11/2024
2.1.22 77 4/11/2024
2.1.21 103 4/10/2024
2.1.20 83 4/10/2024
2.1.19 72 4/10/2024
2.1.18 86 4/10/2024
2.1.17 76 4/10/2024
2.1.16 82 4/10/2024
2.1.15 61 4/10/2024
2.1.14 235 4/3/2024
2.1.13 77 4/2/2024
2.1.12 70 4/2/2024
2.1.11 66 4/2/2024
2.1.10 69 4/2/2024
2.1.9 55 4/2/2024
2.1.8 71 4/1/2024
2.1.7 69 4/1/2024
2.1.6 64 4/1/2024
2.1.5 79 3/31/2024
2.1.4 79 3/30/2024
2.1.3 73 3/30/2024
2.1.2 80 3/27/2024