prmToolkit.EnumExtension 2.0.3

dotnet add package prmToolkit.EnumExtension --version 2.0.3                
NuGet\Install-Package prmToolkit.EnumExtension -Version 2.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="prmToolkit.EnumExtension" Version="2.0.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add prmToolkit.EnumExtension --version 2.0.3                
#r "nuget: prmToolkit.EnumExtension, 2.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.
// Install prmToolkit.EnumExtension as a Cake Addin
#addin nuget:?package=prmToolkit.EnumExtension&version=2.0.3

// Install prmToolkit.EnumExtension as a Cake Tool
#tool nuget:?package=prmToolkit.EnumExtension&version=2.0.3                

prmToolkit

EnumExtension

Classe responsável por adicionar novos recursos ao Enum. A partir da versão 2.0 do pacote Nuget, o projeto foi migrado para .Net Standard 2.0

Installation - EnumExtension

Para instalar, abra o prompt de comando Package Manager Console do seu Visual Studio e digite o comando abaixo:

Para adicionar somente a referencia da dll

Install-Package prmToolkit.EnumExtension

Recursos disponíveis

  • GetDescription (obtém a descrição do enum)
  • ToEnum (Obtém o Enum através do nome passado)
  • GetAttribute (Obtém o atributo customizado do enum)
  • IsEnumValid (Validar se o valor que está no Enum foi definido corretamente)
  • IsEnumValid (Validar se o valor inteiro pertence a um Enum especifico)
  • GetName(Obtem o nome do Enum selecionado)

Alguns exemplos

//Exemplo de Enum
public enum EnumAtuacao
{
    [Description("Responsável por dirigir o veículo")]
    Motorista = 0,
    [Description("Responsável por cobrar a passagem")]
    Cobrador = 1,

    Despachante = 2,

    Fiscal = 3,

    MonitorDePonto = 4
}
    
    
public void Exemplo(){
  //Para obter a descrição que foi definida nas anotações do Enum
  string nomeDoAtributoDaAtuacao = atuacao.GetDescription();
}


public Inserir(EnumAtuacao atuacao, DateTime dataDeContratacao)
{
    //Verifica se o valor que foi passado por parametro no Enum existe dentro das definições do EnumAtuacao
    bool enumValido = atuacao.IsEnumValid();

    //É possível testar se um inteiro contém dentro da definição de um Enum
    int valor = 99;
    bool enumValido = valor.IsEnumValid<EnumAtuacao>();
}
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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 was computed.  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. 
.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.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on prmToolkit.EnumExtension:

Package Downloads
prmToolkit.Log

Pacote responsável por gerenciar os logs da aplicação. Suporte a gravação de log: - File - EventViewer - Database (MySql, SqlServer e Firebird) Recursos Todo o comportamento do log deve ser informado diretamente no arquivo de configuração de seu projeto, com isso caso seja necessário mudar a estratégia de gravação de log, você não precisa recompilar sua aplicação.

prmToolkit.Zap.Helper

Pacote exclusivo para quem contratou a API do WhatsApp. Para saber mais chame no WhatsApp https://olha.la/paulorogerio

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.3 1,708 1/25/2018
2.0.1 1,079 11/10/2017
1.0.1 1,173 4/5/2017
1.0.0 886 4/5/2017

Adicionado novo método
- GetName