public override bool Equals(System.Object otherSpecialty) { if (!(otherSpecialty is Specialty)) { return(false); } else { Specialty newSpecialty = (Specialty)otherSpecialty; bool idEquality = (this.GetId() == newSpecialty.GetId()); bool nameEquality = (this.GetNameSpecialty() == newSpecialty.GetNameSpecialty()); return(idEquality && nameEquality); } }