Soenneker.SmartEnum.Abbreviated
2.1.164
See the version list below for details.
dotnet add package Soenneker.SmartEnum.Abbreviated --version 2.1.164
NuGet\Install-Package Soenneker.SmartEnum.Abbreviated -Version 2.1.164
<PackageReference Include="Soenneker.SmartEnum.Abbreviated" Version="2.1.164" />
paket add Soenneker.SmartEnum.Abbreviated --version 2.1.164
#r "nuget: Soenneker.SmartEnum.Abbreviated, 2.1.164"
// Install Soenneker.SmartEnum.Abbreviated as a Cake Addin
#addin nuget:?package=Soenneker.SmartEnum.Abbreviated&version=2.1.164
// Install Soenneker.SmartEnum.Abbreviated as a Cake Tool
#tool nuget:?package=Soenneker.SmartEnum.Abbreviated&version=2.1.164
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 | Versions 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. |
-
net8.0
- Ardalis.SmartEnum (>= 8.0.0)
- Soenneker.Extensions.String (>= 2.1.174)
- Soenneker.Extensions.Type (>= 2.1.229)
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.186 | 5 | 6/22/2024 |
2.1.185 | 25 | 6/22/2024 |
2.1.184 | 35 | 6/22/2024 |
2.1.183 | 119 | 6/16/2024 |
2.1.182 | 75 | 6/15/2024 |
2.1.181 | 73 | 6/15/2024 |
2.1.180 | 78 | 6/15/2024 |
2.1.179 | 79 | 6/15/2024 |
2.1.178 | 58 | 6/15/2024 |
2.1.177 | 78 | 6/15/2024 |
2.1.176 | 63 | 6/15/2024 |
2.1.175 | 84 | 6/15/2024 |
2.1.174 | 70 | 6/15/2024 |
2.1.173 | 78 | 6/14/2024 |
2.1.172 | 62 | 6/14/2024 |
2.1.171 | 79 | 6/14/2024 |
2.1.170 | 119 | 6/4/2024 |
2.1.169 | 82 | 6/4/2024 |
2.1.168 | 125 | 6/2/2024 |
2.1.167 | 84 | 6/1/2024 |
2.1.166 | 79 | 6/1/2024 |
2.1.165 | 78 | 6/1/2024 |
2.1.164 | 72 | 6/1/2024 |
2.1.163 | 90 | 6/1/2024 |
2.1.162 | 93 | 6/1/2024 |
2.1.161 | 66 | 6/1/2024 |
2.1.160 | 67 | 6/1/2024 |
2.1.159 | 86 | 6/1/2024 |
2.1.158 | 83 | 5/31/2024 |
2.1.157 | 79 | 5/31/2024 |
2.1.156 | 97 | 5/31/2024 |
2.1.155 | 76 | 5/31/2024 |
2.1.154 | 72 | 5/31/2024 |
2.1.153 | 113 | 5/29/2024 |
2.1.152 | 77 | 5/29/2024 |
2.1.151 | 76 | 5/29/2024 |
2.1.150 | 73 | 5/29/2024 |
2.1.149 | 69 | 5/29/2024 |
2.1.148 | 128 | 5/28/2024 |
2.1.147 | 73 | 5/28/2024 |
2.1.146 | 81 | 5/28/2024 |
2.1.145 | 72 | 5/28/2024 |
2.1.144 | 84 | 5/28/2024 |
2.1.143 | 58 | 5/28/2024 |
2.1.142 | 67 | 5/27/2024 |
2.1.141 | 64 | 5/27/2024 |
2.1.140 | 73 | 5/27/2024 |
2.1.139 | 78 | 5/27/2024 |
2.1.138 | 78 | 5/27/2024 |
2.1.137 | 61 | 5/27/2024 |
2.1.136 | 66 | 5/26/2024 |
2.1.135 | 99 | 5/26/2024 |
2.1.134 | 74 | 5/26/2024 |
2.1.133 | 73 | 5/26/2024 |
2.1.132 | 80 | 5/26/2024 |
2.1.131 | 82 | 5/26/2024 |
2.1.130 | 71 | 5/26/2024 |
2.1.129 | 68 | 5/26/2024 |
2.1.128 | 84 | 5/25/2024 |
2.1.127 | 65 | 5/25/2024 |
2.1.126 | 81 | 5/25/2024 |
2.1.125 | 68 | 5/25/2024 |
2.1.124 | 68 | 5/25/2024 |
2.1.123 | 64 | 5/25/2024 |
2.1.122 | 91 | 5/25/2024 |
2.1.121 | 70 | 5/25/2024 |
2.1.120 | 78 | 5/25/2024 |
2.1.119 | 70 | 5/25/2024 |
2.1.118 | 94 | 5/25/2024 |
2.1.117 | 98 | 5/23/2024 |
2.1.116 | 68 | 5/23/2024 |
2.1.115 | 71 | 5/23/2024 |
2.1.114 | 63 | 5/23/2024 |
2.1.113 | 87 | 5/23/2024 |
2.1.112 | 69 | 5/23/2024 |
2.1.111 | 70 | 5/23/2024 |
2.1.110 | 93 | 5/23/2024 |
2.1.109 | 67 | 5/23/2024 |
2.1.108 | 85 | 5/22/2024 |
2.1.107 | 67 | 5/22/2024 |
2.1.106 | 86 | 5/22/2024 |
2.1.105 | 68 | 5/22/2024 |
2.1.104 | 81 | 5/22/2024 |
2.1.103 | 65 | 5/22/2024 |
2.1.102 | 65 | 5/22/2024 |
2.1.101 | 81 | 5/22/2024 |
2.1.100 | 91 | 5/18/2024 |
2.1.99 | 82 | 5/18/2024 |
2.1.98 | 92 | 5/18/2024 |
2.1.97 | 73 | 5/18/2024 |
2.1.96 | 81 | 5/18/2024 |
2.1.95 | 80 | 5/18/2024 |
2.1.94 | 100 | 5/17/2024 |
2.1.93 | 90 | 5/17/2024 |
2.1.92 | 99 | 5/17/2024 |
2.1.91 | 80 | 5/17/2024 |
2.1.90 | 90 | 5/17/2024 |
2.1.89 | 85 | 5/17/2024 |
2.1.88 | 116 | 5/16/2024 |
2.1.87 | 87 | 5/16/2024 |
2.1.86 | 81 | 5/16/2024 |
2.1.85 | 91 | 5/15/2024 |
2.1.84 | 81 | 5/15/2024 |
2.1.83 | 89 | 5/15/2024 |
2.1.82 | 103 | 5/15/2024 |
2.1.81 | 78 | 5/15/2024 |
2.1.80 | 98 | 5/13/2024 |
2.1.79 | 72 | 5/13/2024 |
2.1.78 | 71 | 5/13/2024 |
2.1.77 | 71 | 5/13/2024 |
2.1.76 | 136 | 4/30/2024 |
2.1.75 | 93 | 4/30/2024 |
2.1.74 | 89 | 4/30/2024 |
2.1.73 | 81 | 4/30/2024 |
2.1.72 | 97 | 4/30/2024 |
2.1.71 | 74 | 4/29/2024 |
2.1.70 | 75 | 4/29/2024 |
2.1.69 | 95 | 4/29/2024 |
2.1.68 | 76 | 4/29/2024 |
2.1.67 | 73 | 4/29/2024 |
2.1.66 | 77 | 4/29/2024 |
2.1.65 | 76 | 4/28/2024 |
2.1.64 | 68 | 4/28/2024 |
2.1.63 | 85 | 4/28/2024 |
2.1.62 | 68 | 4/28/2024 |
2.1.61 | 83 | 4/28/2024 |
2.1.60 | 82 | 4/28/2024 |
2.1.59 | 93 | 4/28/2024 |
2.1.58 | 65 | 4/28/2024 |
2.1.57 | 81 | 4/28/2024 |
2.1.56 | 69 | 4/28/2024 |
2.1.55 | 84 | 4/28/2024 |
2.1.54 | 69 | 4/28/2024 |
2.1.53 | 84 | 4/28/2024 |
2.1.52 | 73 | 4/28/2024 |
2.1.51 | 79 | 4/27/2024 |
2.1.50 | 175 | 4/20/2024 |
2.1.49 | 90 | 4/20/2024 |
2.1.48 | 95 | 4/19/2024 |
2.1.47 | 73 | 4/19/2024 |
2.1.46 | 77 | 4/19/2024 |
2.1.45 | 70 | 4/19/2024 |
2.1.44 | 89 | 4/19/2024 |
2.1.43 | 91 | 4/19/2024 |
2.1.42 | 78 | 4/19/2024 |
2.1.41 | 86 | 4/18/2024 |
2.1.40 | 138 | 4/13/2024 |
2.1.39 | 90 | 4/13/2024 |
2.1.38 | 82 | 4/13/2024 |
2.1.37 | 86 | 4/13/2024 |
2.1.36 | 56 | 4/13/2024 |
2.1.35 | 90 | 4/12/2024 |
2.1.34 | 82 | 4/12/2024 |
2.1.33 | 68 | 4/12/2024 |
2.1.32 | 92 | 4/12/2024 |
2.1.31 | 75 | 4/12/2024 |
2.1.30 | 88 | 4/12/2024 |
2.1.29 | 68 | 4/12/2024 |
2.1.28 | 105 | 4/12/2024 |
2.1.27 | 63 | 4/12/2024 |
2.1.26 | 86 | 4/12/2024 |
2.1.25 | 77 | 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 | 234 | 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 | 54 | 4/2/2024 |
2.1.8 | 70 | 4/1/2024 |
2.1.7 | 68 | 4/1/2024 |
2.1.6 | 63 | 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 |