Exemple #1
0
        /// <summary>
        /// Serves as the default hash function.
        /// </summary>
        /// <returns>A hash code for the current object.</returns>
        public override int GetHashCode()
        {
            var hashcode = ID.GetHashCode();

            hashcode ^= CheckpointID.GetHashCode();
            hashcode ^= AdmissionID.GetHashCode();
            return(hashcode);
        }
Exemple #2
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>true if the specified object is equal to the current object; otherwise, false.</returns>
        public override bool Equals(object obj)
        {
            var result = false;

            if (obj is CheckpointAdmission item)
            {
                result  = ID == item.ID;
                result &= CheckpointID.Equals(item.CheckpointID);
                result &= AdmissionID.Equals(item.AdmissionID);
                return(result);
            }
            return(false);
        }