/// <summary> /// Returns true if RequestTransportation instances are equal /// </summary> /// <param name="other">Instance of RequestTransportation to be compared</param> /// <returns>Boolean</returns> public bool Equals(RequestTransportation other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Type == other.Type || Type.Equals(other.Type) ) && ( PtChangeDelay == other.PtChangeDelay || PtChangeDelay.Equals(other.PtChangeDelay) ) && ( WalkingTime == other.WalkingTime || WalkingTime.Equals(other.WalkingTime) ) && ( DrivingTimeToStation == other.DrivingTimeToStation || DrivingTimeToStation.Equals(other.DrivingTimeToStation) ) && ( ParkingTime == other.ParkingTime || ParkingTime.Equals(other.ParkingTime) ) && ( BoardingTime == other.BoardingTime || BoardingTime.Equals(other.BoardingTime) )); }
/// <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 + Type.GetHashCode(); hashCode = hashCode * 59 + PtChangeDelay.GetHashCode(); hashCode = hashCode * 59 + WalkingTime.GetHashCode(); hashCode = hashCode * 59 + DrivingTimeToStation.GetHashCode(); hashCode = hashCode * 59 + ParkingTime.GetHashCode(); hashCode = hashCode * 59 + BoardingTime.GetHashCode(); return(hashCode); } }