using System.ComponentModel;
public enum PaymentOrderStatus
[Description("Pendente")]
[Description("Liberada")]
[Description("Aprovada")]
public enum CustomerStatus
public static class EnumDescriptionHelper
public static string GetDescription(this Enum GenericEnum)
Type genericEnumType = GenericEnum.GetType();
MemberInfo[] memberInfo = genericEnumType.GetMember(GenericEnum.ToString());
if ((memberInfo != null && memberInfo.Length > 0))
var _Attribs = memberInfo[0].GetCustomAttributes(typeof(System.ComponentModel.DescriptionAttribute), false);
if ((_Attribs != null && _Attribs.Count() > 0))
return ((System.ComponentModel.DescriptionAttribute)_Attribs.ElementAt(0)).Description;
return GenericEnum.ToString();
public static void Main()
var paymentOrderStatus = PaymentOrderStatus.Pending;
var customerStatus = CustomerStatus.Active;
var qualStatus = (PaymentOrderStatus)indice;
Console.WriteLine(paymentOrderStatus.GetDescription());
Console.WriteLine(customerStatus.GetDescription());
Console.WriteLine(qualStatus.GetDescription());