示例#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 (Athlete != null)
         {
             hashCode = hashCode * 59 + Athlete.GetHashCode();
         }
         if (Description != null)
         {
             hashCode = hashCode * 59 + Description.GetHashCode();
         }
         if (Distance != null)
         {
             hashCode = hashCode * 59 + Distance.GetHashCode();
         }
         if (ElevationGain != null)
         {
             hashCode = hashCode * 59 + ElevationGain.GetHashCode();
         }
         if (Id != null)
         {
             hashCode = hashCode * 59 + Id.GetHashCode();
         }
         if (IdStr != null)
         {
             hashCode = hashCode * 59 + IdStr.GetHashCode();
         }
         if (Map != null)
         {
             hashCode = hashCode * 59 + Map.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (_Private != null)
         {
             hashCode = hashCode * 59 + _Private.GetHashCode();
         }
         if (Starred != null)
         {
             hashCode = hashCode * 59 + Starred.GetHashCode();
         }
         if (Timestamp != null)
         {
             hashCode = hashCode * 59 + Timestamp.GetHashCode();
         }
         if (Type != null)
         {
             hashCode = hashCode * 59 + Type.GetHashCode();
         }
         if (SubType != null)
         {
             hashCode = hashCode * 59 + SubType.GetHashCode();
         }
         if (CreatedAt != null)
         {
             hashCode = hashCode * 59 + CreatedAt.GetHashCode();
         }
         if (UpdatedAt != null)
         {
             hashCode = hashCode * 59 + UpdatedAt.GetHashCode();
         }
         if (EstimatedMovingTime != null)
         {
             hashCode = hashCode * 59 + EstimatedMovingTime.GetHashCode();
         }
         if (Segments != null)
         {
             hashCode = hashCode * 59 + Segments.GetHashCode();
         }
         return(hashCode);
     }
 }
示例#2
0
        /// <summary>
        /// Returns true if Route instances are equal
        /// </summary>
        /// <param name="other">Instance of Route to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Route other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Athlete == other.Athlete ||
                     Athlete != null &&
                     Athlete.Equals(other.Athlete)
                     ) &&
                 (
                     Description == other.Description ||
                     Description != null &&
                     Description.Equals(other.Description)
                 ) &&
                 (
                     Distance == other.Distance ||
                     Distance != null &&
                     Distance.Equals(other.Distance)
                 ) &&
                 (
                     ElevationGain == other.ElevationGain ||
                     ElevationGain != null &&
                     ElevationGain.Equals(other.ElevationGain)
                 ) &&
                 (
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                 ) &&
                 (
                     IdStr == other.IdStr ||
                     IdStr != null &&
                     IdStr.Equals(other.IdStr)
                 ) &&
                 (
                     Map == other.Map ||
                     Map != null &&
                     Map.Equals(other.Map)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     _Private == other._Private ||
                     _Private != null &&
                     _Private.Equals(other._Private)
                 ) &&
                 (
                     Starred == other.Starred ||
                     Starred != null &&
                     Starred.Equals(other.Starred)
                 ) &&
                 (
                     Timestamp == other.Timestamp ||
                     Timestamp != null &&
                     Timestamp.Equals(other.Timestamp)
                 ) &&
                 (
                     Type == other.Type ||
                     Type != null &&
                     Type.Equals(other.Type)
                 ) &&
                 (
                     SubType == other.SubType ||
                     SubType != null &&
                     SubType.Equals(other.SubType)
                 ) &&
                 (
                     CreatedAt == other.CreatedAt ||
                     CreatedAt != null &&
                     CreatedAt.Equals(other.CreatedAt)
                 ) &&
                 (
                     UpdatedAt == other.UpdatedAt ||
                     UpdatedAt != null &&
                     UpdatedAt.Equals(other.UpdatedAt)
                 ) &&
                 (
                     EstimatedMovingTime == other.EstimatedMovingTime ||
                     EstimatedMovingTime != null &&
                     EstimatedMovingTime.Equals(other.EstimatedMovingTime)
                 ) &&
                 (
                     Segments == other.Segments ||
                     Segments != null &&
                     Segments.SequenceEqual(other.Segments)
                 ));
        }