TL.EnumExtensionsLibrary 0.0.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package TL.EnumExtensionsLibrary --version 0.0.3
                    
NuGet\Install-Package TL.EnumExtensionsLibrary -Version 0.0.3
                    
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="TL.EnumExtensionsLibrary" Version="0.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TL.EnumExtensionsLibrary" Version="0.0.3" />
                    
Directory.Packages.props
<PackageReference Include="TL.EnumExtensionsLibrary" />
                    
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 TL.EnumExtensionsLibrary --version 0.0.3
                    
#r "nuget: TL.EnumExtensionsLibrary, 0.0.3"
                    
#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 TL.EnumExtensionsLibrary@0.0.3
                    
#: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=TL.EnumExtensionsLibrary&version=0.0.3
                    
Install as a Cake Addin
#tool nuget:?package=TL.EnumExtensionsLibrary&version=0.0.3
                    
Install as a Cake Tool

EnumExtensions

With EnumExtensions, you can effortlessly convert enumerations to dictionaries, retrieve all enumeration values and names, and perform various other advanced operations, ensuring a more efficient and effective development process.

Instalação

Você pode instalar a biblioteca via NuGet. No seu terminal, execute:

dotnet add package TL.EnumExtensionsLibrary

Usage

Once you have installed the Enum extension library within your project. Enum extensions functions will be available on all string types

            public enum SystemErrorCodes
            {
                [Description("An unknown error occurred.")]
                Unknown,
                [Description("The system is out of memory.")]
                OutOfMemory,
                [Description("An invalid parameter was provided.")]
                InvalidParameter,
                [Description("An application error occurred.")]
                Application,
                [Description("A business error occurred.")]
                Business,
                [Description("A database error occurred.")]
                Database
            }

            public enum Priority
            {
                Urgent,
                High,
                Medium,
                Low
            }

            IList<Priority> valoresPriority = Enum.GetValues<Priority>();
            Console.WriteLine("Valores do enum Cores:");
            foreach (var cor in valoresPriority)
            {
                Console.WriteLine(cor);
            }

            IList<string> nomesPriority = Enum.GetNames<Priority>();
            Console.WriteLine("\nNomes do enum Cores:");
            foreach (var nome in nomesPriority)
            {
                Console.WriteLine(nome);
            }
            Console.WriteLine(SystemErrorCodes.Application.GetDescription<SystemErrorCodes>());

            Console.WriteLine(Priority.Parse<Priority>("Urgent"));


            public enum EnvironmentType
            {
                [EnumDescription(0, "Development Environment")]
                [EnumDescription(1, "Staging Environment")]
                [EnumDescription(2, "Production Environment")]
                Beta,

                [EnumDescription(1, "Development Environment")]
                [EnumDescription(2, "Staging Environment")]
                [EnumDescription(3, "Production Environment")]
                [EnumDescription(4, "Staging Environment")]
                Release
            }
            
            var environmentBeta = EnvironmentType.Beta;
            var environmentRelease = EnvironmentType.Release;

            Console.WriteLine(environmentBeta.GetDescription(0)); // Output: Development Environment
            Console.WriteLine(environmentRelease.GetDescription(3)); // Output: Production Environment

Contribuição

Sinta-se à vontade para contribuir com este projeto! Por favor, abra um pull request ou envie issues para sugestões e melhorias.

Licença

Este projeto está licenciado sob a MIT License - veja o arquivo LICENSE para detalhes.

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.
  • net5.0

    • No dependencies.
  • net6.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on TL.EnumExtensionsLibrary:

Package Downloads
TL.ExtensionLibrary.Domain

Clean Architecture Domain metapackage: pure, high-performance domain extensions (String, Numeric, DateTime, Enum, Collection) with zero external infrastructure dependencies.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.8.0 200 10/1/2026
0.7.0 194 9/26/2026
0.6.0 193 9/22/2026
0.5.0 202 9/16/2026
0.4.2 190 9/16/2026
0.4.1 204 9/11/2026
0.4.0 229 9/6/2026
0.3.0 121 9/6/2026
0.2.0 117 9/5/2026
0.1.0 116 9/4/2026
0.0.3 205 10/24/2024
0.0.2 170 10/17/2024
0.0.1 174 10/16/2024