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