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 typeEquality = this.GetType().Equals(newSpecialty.GetType()); return(idEquality && typeEquality); } }