public string DescreverEnum(TipoEscolaridade val) { DescriptionAttribute[] attributes = (DescriptionAttribute[])val .GetType() .GetField(val.ToString()) .GetCustomAttributes(typeof(DescriptionAttribute), false); return(attributes.Length > 0 ? attributes[0].Description : string.Empty); }
public void DadosFixos() { Nome = "Rubem"; Sobrenome = "Oliota"; DataNascimento = new DateTime(1989, 04, 08); CorFavorita = CoresConsole.Cores.Verde; Curso = "Fundamentos C#"; Matricula = "20210130"; Instrutor = "Rubem Oliota"; Escolaridade = TipoEscolaridade.Graduado; InteressesPessoais = new List <string>(); InteressesPessoais.Add("Basquete"); InteressesPessoais.Add("Artesanato em biscuit"); InteressesPessoais.Add("Desenvolver aplicativos android"); InteressesPessoais.Add("Robotica com lego"); InteressesPessoais.Add("Invenções"); InteressesPessoais.Add("Tecnologia"); }