예제 #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 :)
                if (Id != null)
                {
                    hashCode = hashCode * 59 + Id.GetHashCode();
                }
                if (Transportation != null)
                {
                    hashCode = hashCode * 59 + Transportation.GetHashCode();
                }

                hashCode = hashCode * 59 + TravelTime.GetHashCode();
                if (ArrivalTime != null)
                {
                    hashCode = hashCode * 59 + ArrivalTime.GetHashCode();
                }

                hashCode = hashCode * 59 + ReachablePostcodesThreshold.GetHashCode();
                if (Properties != null)
                {
                    hashCode = hashCode * 59 + Properties.GetHashCode();
                }
                if (Range != null)
                {
                    hashCode = hashCode * 59 + Range.GetHashCode();
                }
                return(hashCode);
            }
        }
예제 #2
0
        /// <summary>
        /// Returns true if RequestTimeFilterPostcodeDistrictsArrivalSearch instances are equal
        /// </summary>
        /// <param name="other">Instance of RequestTimeFilterPostcodeDistrictsArrivalSearch to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(RequestTimeFilterPostcodeDistrictsArrivalSearch other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                     ) &&
                 (
                     Transportation == other.Transportation ||
                     Transportation != null &&
                     Transportation.Equals(other.Transportation)
                 ) &&
                 (
                     TravelTime == other.TravelTime ||

                     TravelTime.Equals(other.TravelTime)
                 ) &&
                 (
                     ArrivalTime == other.ArrivalTime ||
                     ArrivalTime != null &&
                     ArrivalTime.Equals(other.ArrivalTime)
                 ) &&
                 (
                     ReachablePostcodesThreshold == other.ReachablePostcodesThreshold ||

                     ReachablePostcodesThreshold.Equals(other.ReachablePostcodesThreshold)
                 ) &&
                 (
                     Properties == other.Properties ||
                     Properties != null &&
                     other.Properties != null &&
                     Properties.SequenceEqual(other.Properties)
                 ) &&
                 (
                     Range == other.Range ||
                     Range != null &&
                     Range.Equals(other.Range)
                 ));
        }