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 nameEquality = this.GetName() == newCourse.GetName(); return(idEquality && nameEquality); } }