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

                hashCode = hashCode * 59 + TravelTime.GetHashCode();

                hashCode = hashCode * 59 + Distance.GetHashCode();
                if (DistanceBreakdown != null)
                {
                    hashCode = hashCode * 59 + DistanceBreakdown.GetHashCode();
                }
                if (Fares != null)
                {
                    hashCode = hashCode * 59 + Fares.GetHashCode();
                }
                if (Route != null)
                {
                    hashCode = hashCode * 59 + Route.GetHashCode();
                }
                return(hashCode);
            }
        }
        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                var hashCode = 41;
                // Suitable nullity checks etc, of course :)
                if (PublicTransport != null)
                {
                    hashCode = hashCode * 59 + PublicTransport.GetHashCode();
                }

                hashCode = hashCode * 59 + Fares.GetHashCode();

                hashCode = hashCode * 59 + Postcodes.GetHashCode();
                return(hashCode);
            }
        }