Example #1
0
        static void MainObject()
        {
            Dni dni = new Dni("12345678Z");

            Console.WriteLine(dni.Numero);
            Console.WriteLine(dni.Letra);

            Console.WriteLine(dni.ToString());

            Dni dni2 = dni;

            Console.WriteLine("El DNI ES: " + dni);
            Console.WriteLine(dni.GetHashCode());
            Console.WriteLine(new Dni("12345678Z").GetHashCode());
            Console.WriteLine(dni2.GetHashCode());

            dni.Numero = 87654321;

            Console.WriteLine(dni);
            Console.WriteLine(dni.GetHashCode());

            Console.WriteLine(new Dni("12345678Z") == new Dni("12345678Z"));
            Console.WriteLine(new Dni("12345678Z").Equals(new Dni("12345678Z")));
            Console.WriteLine(new Dni("12345678Z") != new Dni("12345678Z"));

            UsuarioExtendido ue = new UsuarioExtendido();

            Usuario u = ue;

            Console.WriteLine(u.GetTexto());

            UsuarioExtendido ue2 = u as UsuarioExtendido;

            Console.WriteLine(ue2.GetTexto());

            Console.WriteLine(new Usuario().GetTexto());

            Usuario usuario = new UsuarioExtendido();
        }
Example #2
0
 // override object.GetHashCode
 public override int GetHashCode()
 {
     return(Id.GetHashCode() * 17 + Nombre.GetHashCode() + Apellidos.GetHashCode() + Dni.GetHashCode() + Guid.GetHashCode() + FechaNacimiento.GetHashCode());
 }
Example #3
0
 public override int GetHashCode()
 {
     return(Dni.GetHashCode());
 }
Example #4
0
 public override int GetHashCode()
 {
     return(Id.GetHashCode() & ApYNom.GetHashCode() & EstaEliminado.GetHashCode() & Dni.GetHashCode() & Dni.GetHashCode() & FechaNacimiento.GetHashCode() & Telefono.GetHashCode()
            & Celular.GetHashCode() & Email.GetHashCode() & Sexo.GetHashCode());
 }
 // override object.GetHashCode
 public override int GetHashCode()
 {
     return(Id.GetHashCode() * 17 + Nombre.GetHashCode() + Apellidos.GetHashCode() + Dni.GetHashCode() + GUID.GetHashCode());
 }