Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. public class Estabelecimento
  2. {
  3. public Estabelecimento(long cnpj, TipoCnpj tipoEstabelecimento)
  4. {
  5. Cnpj = cnpj;
  6. TipoEstabelecimento = tipoEstabelecimento;
  7. }
  8.  
  9. public readonly long Cnpj;
  10. public readonly TipoCnpj TipoEstabelecimento;
  11.  
  12. public override bool Equals(Object obj)
  13. {
  14. if (obj == null)
  15. {
  16. return false;
  17. }
  18.  
  19. Estabelecimento outroEstabelecimento = (Estabelecimento)obj;
  20. if (outroEstabelecimento == null)
  21. {
  22. return false;
  23. }
  24.  
  25. return (Cnpj == outroEstabelecimento.Cnpj && TipoEstabelecimento == outroEstabelecimento.TipoEstabelecimento);
  26. }
  27.  
  28. public override int GetHashCode()
  29. {
  30. return Cnpj.GetHashCode();
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement