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(); }
// override object.GetHashCode public override int GetHashCode() { return(Id.GetHashCode() * 17 + Nombre.GetHashCode() + Apellidos.GetHashCode() + Dni.GetHashCode() + Guid.GetHashCode() + FechaNacimiento.GetHashCode()); }
public override int GetHashCode() { return(Dni.GetHashCode()); }
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()); }