public override bool Equals(System.Object otherStudent) { if (!(otherStudent is Student)) { return(false); } else { Student newStudent = (Student)otherStudent; bool idEquality = (this.GetId() == newStudent.GetId()); bool firstNameEq = (this.GetFirstName() == newStudent.GetFirstName()); bool lastNameEq = (this.GetLastName() == newStudent.GetLastName()); bool dateOfEnrollmentEq = (this.GetDateOfEnrollment() == newStudent.GetDateOfEnrollment()); return(idEquality && firstNameEq && lastNameEq && dateOfEnrollmentEq); } }
public override bool Equals(System.Object otherStudent) { if (!(otherStudent is Student)) { return(false); } else { Student newStudent = (Student)otherStudent; bool firstNameEquality = (this.GetFirstName() == newStudent.GetFirstName()); bool lastNameEquality = (this.GetLastName() == newStudent.GetLastName()); bool rawDateEquality = (this.GetDate() == newStudent.GetDate()); bool idEquality = (this.GetId() == newStudent.GetId()); return(firstNameEquality && lastNameEquality && rawDateEquality && idEquality); } }