public override bool Equals(object obj) { if (obj is PalindromeResult) { var other = obj as PalindromeResult; return(Palindrome.Equals(other.Palindrome) && StartIndex.Equals(other.StartIndex) && EndIndex.Equals(other.EndIndex)); } throw new ArgumentException("Cannot compare to anything but a PalindromeResult", nameof(obj)); }
/// <summary> /// Returns true if Lap instances are equal /// </summary> /// <param name="other">Instance of Lap to be compared</param> /// <returns>Boolean</returns> public bool Equals(Lap other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Id == other.Id || Id != null && Id.Equals(other.Id) ) && ( Activity == other.Activity || Activity != null && Activity.Equals(other.Activity) ) && ( Athlete == other.Athlete || Athlete != null && Athlete.Equals(other.Athlete) ) && ( AverageCadence == other.AverageCadence || AverageCadence != null && AverageCadence.Equals(other.AverageCadence) ) && ( AverageSpeed == other.AverageSpeed || AverageSpeed != null && AverageSpeed.Equals(other.AverageSpeed) ) && ( Distance == other.Distance || Distance != null && Distance.Equals(other.Distance) ) && ( ElapsedTime == other.ElapsedTime || ElapsedTime != null && ElapsedTime.Equals(other.ElapsedTime) ) && ( StartIndex == other.StartIndex || StartIndex != null && StartIndex.Equals(other.StartIndex) ) && ( EndIndex == other.EndIndex || EndIndex != null && EndIndex.Equals(other.EndIndex) ) && ( LapIndex == other.LapIndex || LapIndex != null && LapIndex.Equals(other.LapIndex) ) && ( MaxSpeed == other.MaxSpeed || MaxSpeed != null && MaxSpeed.Equals(other.MaxSpeed) ) && ( MovingTime == other.MovingTime || MovingTime != null && MovingTime.Equals(other.MovingTime) ) && ( Name == other.Name || Name != null && Name.Equals(other.Name) ) && ( PaceZone == other.PaceZone || PaceZone != null && PaceZone.Equals(other.PaceZone) ) && ( Split == other.Split || Split != null && Split.Equals(other.Split) ) && ( StartDate == other.StartDate || StartDate != null && StartDate.Equals(other.StartDate) ) && ( StartDateLocal == other.StartDateLocal || StartDateLocal != null && StartDateLocal.Equals(other.StartDateLocal) ) && ( TotalElevationGain == other.TotalElevationGain || TotalElevationGain != null && TotalElevationGain.Equals(other.TotalElevationGain) )); }
/// <summary> /// Returns true if DetailedSegmentEffort instances are equal /// </summary> /// <param name="other">Instance of DetailedSegmentEffort to be compared</param> /// <returns>Boolean</returns> public bool Equals(DetailedSegmentEffort other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Name == other.Name || Name != null && Name.Equals(other.Name) ) && ( Activity == other.Activity || Activity != null && Activity.Equals(other.Activity) ) && ( Athlete == other.Athlete || Athlete != null && Athlete.Equals(other.Athlete) ) && ( MovingTime == other.MovingTime || MovingTime != null && MovingTime.Equals(other.MovingTime) ) && ( StartIndex == other.StartIndex || StartIndex != null && StartIndex.Equals(other.StartIndex) ) && ( EndIndex == other.EndIndex || EndIndex != null && EndIndex.Equals(other.EndIndex) ) && ( AverageCadence == other.AverageCadence || AverageCadence != null && AverageCadence.Equals(other.AverageCadence) ) && ( AverageWatts == other.AverageWatts || AverageWatts != null && AverageWatts.Equals(other.AverageWatts) ) && ( DeviceWatts == other.DeviceWatts || DeviceWatts != null && DeviceWatts.Equals(other.DeviceWatts) ) && ( AverageHeartrate == other.AverageHeartrate || AverageHeartrate != null && AverageHeartrate.Equals(other.AverageHeartrate) ) && ( MaxHeartrate == other.MaxHeartrate || MaxHeartrate != null && MaxHeartrate.Equals(other.MaxHeartrate) ) && ( Segment == other.Segment || Segment != null && Segment.Equals(other.Segment) ) && ( KomRank == other.KomRank || KomRank != null && KomRank.Equals(other.KomRank) ) && ( PrRank == other.PrRank || PrRank != null && PrRank.Equals(other.PrRank) ) && ( Hidden == other.Hidden || Hidden != null && Hidden.Equals(other.Hidden) )); }