Advertisement
paulluscastro

Enumeration Sexo

May 22nd, 2018
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.70 KB | None | 0 0
  1.     public class Sexo : Enumeration
  2.     {
  3.         public static Sexo Masculino = new Sexo(1, "Masculino");
  4.         public static Sexo Feminino = new Sexo(2, "Feminino");
  5.         public static Sexo Travesti = new Sexo(3, "Travesti");
  6.         public static Sexo Crossdresser = new Sexo(4, "Crossdresser");
  7.         public static Sexo AlgumaOutraLoucuraProgressista = new Sexo(5, "Alguma outra loucura progressista");
  8.  
  9.         public static Sexo[] List() =>  new Sexo[] { Masculino, Feminono, Travesti, Crossdresser,AlgumaOutraLoucuraProgressista };
  10.         public static Sexo From(int id) => List().Where(c => c.Id == id).FirstOrDefault();
  11.  
  12.         private Sexo(int id, string name) : base(id, name) { }
  13.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement