Ejemplo n.º 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);
            }
            Result result = obj as Result;

            if (result == null)
            {
                return(false);
            }
            return(IdExam.Equals(result.IdExam) && IdStudent.Equals(result.IdStudent) &&
                   Mark.Equals(result.Mark));
        }
Ejemplo n.º 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(Mark.GetHashCode() * 4 + IdExam.GetHashCode() + IdStudent.GetHashCode());
 }