public override bool Equals(System.Object otherSpeciality) { if (!(otherSpeciality is Speciality)) { return(false); } else { Speciality newSpeciality = (Speciality)otherSpeciality; bool areIdsEqual = (this.GetId() == newSpeciality.GetId()); bool areNamesEqual = (this.GetDescription() == newSpeciality.GetDescription()); return(areIdsEqual && areNamesEqual); } }
public override bool Equals(System.Object otherSpeciality) { if (!(otherSpeciality is Speciality)) { return(false); } else { Speciality newSpeciality = (Speciality)otherSpeciality; bool idEquality = this.GetId() == newSpeciality.GetId(); bool descriptionEquality = this.GetDescription() == newSpeciality.GetDescription(); return(idEquality && descriptionEquality); } }