Пример #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 (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (ActivityType != null)
         {
             hashCode = hashCode * 59 + ActivityType.GetHashCode();
         }
         if (Distance != null)
         {
             hashCode = hashCode * 59 + Distance.GetHashCode();
         }
         if (AverageGrade != null)
         {
             hashCode = hashCode * 59 + AverageGrade.GetHashCode();
         }
         if (MaximumGrade != null)
         {
             hashCode = hashCode * 59 + MaximumGrade.GetHashCode();
         }
         if (ElevationHigh != null)
         {
             hashCode = hashCode * 59 + ElevationHigh.GetHashCode();
         }
         if (ElevationLow != null)
         {
             hashCode = hashCode * 59 + ElevationLow.GetHashCode();
         }
         if (StartLatlng != null)
         {
             hashCode = hashCode * 59 + StartLatlng.GetHashCode();
         }
         if (EndLatlng != null)
         {
             hashCode = hashCode * 59 + EndLatlng.GetHashCode();
         }
         if (ClimbCategory != null)
         {
             hashCode = hashCode * 59 + ClimbCategory.GetHashCode();
         }
         if (City != null)
         {
             hashCode = hashCode * 59 + City.GetHashCode();
         }
         if (State != null)
         {
             hashCode = hashCode * 59 + State.GetHashCode();
         }
         if (Country != null)
         {
             hashCode = hashCode * 59 + Country.GetHashCode();
         }
         if (_Private != null)
         {
             hashCode = hashCode * 59 + _Private.GetHashCode();
         }
         if (AthletePrEffort != null)
         {
             hashCode = hashCode * 59 + AthletePrEffort.GetHashCode();
         }
         if (AthleteSegmentStats != null)
         {
             hashCode = hashCode * 59 + AthleteSegmentStats.GetHashCode();
         }
         return(hashCode);
     }
 }