Beispiel #1
0
        /// <summary>
        ///     Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked             // Overflow is fine, just wrap
            {
                int hashCode = 41;
                // Suitable nullity checks etc, of course :)

                hashCode = hashCode * 59 + Number.GetHashCode();
                if (CheckedBy != null)
                {
                    hashCode = hashCode * 59 + CheckedBy.GetHashCode();
                }

                hashCode = hashCode * 59 + Direction.GetHashCode();
                if (Name != null)
                {
                    hashCode = hashCode * 59 + Name.GetHashCode();
                }

                hashCode = hashCode * 59 + Id.GetHashCode();
                if (Location != null)
                {
                    hashCode = hashCode * 59 + Location.GetHashCode();
                }
                return(hashCode);
            }
        }