コード例 #1
0
 public override bool Equals(System.Object otherCourse)
 {
     if (!(otherCourse is Course))
     {
         return(false);
     }
     else
     {
         Course newCourse          = (Course)otherCourse;
         bool   idEquality         = this.GetId() == newCourse.GetId();
         bool   courseNameEquality = this.GetCourseName() == newCourse.GetCourseName();
         bool   courseNoEquality   = this.GetCourseNo() == newCourse.GetCourseNo();
         return(idEquality && courseNameEquality && courseNoEquality);
     }
 }