I created an enum:
public enum EnumTipoBoleto
{
VazioErro=0,
ConfigInicial = 1,
Mensalidade = 2,
Outros =3,
DifMensal =4
}
Now in some places I have the number and want to convert to enum
var variavel = 2;
var valorEnum = EnumTipoBoleto[variavel]; //Como faço?
'EnumTipoBoleto' is a type, which is not valid in the given context