Example #1
0
        /// <summary>
        /// Determines whether the specified object is equal to the current object.
        /// </summary>
        /// <param name="obj">The object to compare with the current object.</param>
        /// <returns>Boolean true if the specified object is equal to the current object; otherwise, false.</returns>
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            Exam exam = obj as Exam;

            if (exam == null)
            {
                return(false);
            }
            return((Date.Equals(exam.Date) && IdSubject.Equals(exam.IdSubject) &&
                    IdGroup.Equals(exam.IdGroup) && Type.Equals(exam.Type)) &&
                   NumberOfSession.Equals(exam.NumberOfSession));
        }
Example #2
0
 /// <summary>
 /// Get a hash code for the current object.
 /// </summary>
 /// <returns>A hash code for the current object.</returns>
 public override int GetHashCode()
 {
     return(Date.GetHashCode() * 4 + IdSubject.GetHashCode() + Type.GetHashCode());
 }