/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { // credit: http://stackoverflow.com/a/263416/677735 unchecked // Overflow is fine, just wrap { int hash = 41; // Suitable nullity checks hash = hash * 59 + Id.GetHashCode(); if (IsSingleAxle != null) { hash = hash * 59 + IsSingleAxle.GetHashCode(); } if (IsTandemAxle != null) { hash = hash * 59 + IsTandemAxle.GetHashCode(); } if (IsTridem != null) { hash = hash * 59 + IsTridem.GetHashCode(); } if (HasPUP != null) { hash = hash * 59 + HasPUP.GetHashCode(); } if (HasBellyDump != null) { hash = hash * 59 + HasBellyDump.GetHashCode(); } if (HasRockBox != null) { hash = hash * 59 + HasRockBox.GetHashCode(); } if (HasHiliftGate != null) { hash = hash * 59 + HasHiliftGate.GetHashCode(); } if (IsWaterTruck != null) { hash = hash * 59 + IsWaterTruck.GetHashCode(); } if (HasSealcoatHitch != null) { hash = hash * 59 + HasSealcoatHitch.GetHashCode(); } if (RearAxleSpacing != null) { hash = hash * 59 + RearAxleSpacing.GetHashCode(); } if (FrontTireSize != null) { hash = hash * 59 + FrontTireSize.GetHashCode(); } if (FrontTireUOM != null) { hash = hash * 59 + FrontTireUOM.GetHashCode(); } if (FrontAxleCapacity != null) { hash = hash * 59 + FrontAxleCapacity.GetHashCode(); } if (RearAxleCapacity != null) { hash = hash * 59 + RearAxleCapacity.GetHashCode(); } if (LegalLoad != null) { hash = hash * 59 + LegalLoad.GetHashCode(); } if (LegalCapacity != null) { hash = hash * 59 + LegalCapacity.GetHashCode(); } if (LegalPUPTareWeight != null) { hash = hash * 59 + LegalPUPTareWeight.GetHashCode(); } if (LicencedGVW != null) { hash = hash * 59 + LicencedGVW.GetHashCode(); } if (LicencedGVWUOM != null) { hash = hash * 59 + LicencedGVWUOM.GetHashCode(); } if (LicencedTareWeight != null) { hash = hash * 59 + LicencedTareWeight.GetHashCode(); } if (LicencedPUPTareWeight != null) { hash = hash * 59 + LicencedPUPTareWeight.GetHashCode(); } if (LicencedLoad != null) { hash = hash * 59 + LicencedLoad.GetHashCode(); } if (LicencedCapacity != null) { hash = hash * 59 + LicencedCapacity.GetHashCode(); } if (BoxLength != null) { hash = hash * 59 + BoxLength.GetHashCode(); } if (BoxWidth != null) { hash = hash * 59 + BoxWidth.GetHashCode(); } if (BoxHeight != null) { hash = hash * 59 + BoxHeight.GetHashCode(); } if (BoxCapacity != null) { hash = hash * 59 + BoxCapacity.GetHashCode(); } if (TrailerBoxLength != null) { hash = hash * 59 + TrailerBoxLength.GetHashCode(); } if (TrailerBoxWidth != null) { hash = hash * 59 + TrailerBoxWidth.GetHashCode(); } if (TrailerBoxHeight != null) { hash = hash * 59 + TrailerBoxHeight.GetHashCode(); } if (TrailerBoxCapacity != null) { hash = hash * 59 + TrailerBoxCapacity.GetHashCode(); } return(hash); } }
/// <summary> /// Returns true if DumpTruck instances are equal /// </summary> /// <param name="other">Instance of DumpTruck to be compared</param> /// <returns>Boolean</returns> public bool Equals(DumpTruck other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Id == other.Id || Id.Equals(other.Id) ) && ( IsSingleAxle == other.IsSingleAxle || IsSingleAxle != null && IsSingleAxle.Equals(other.IsSingleAxle) ) && ( IsTandemAxle == other.IsTandemAxle || IsTandemAxle != null && IsTandemAxle.Equals(other.IsTandemAxle) ) && ( IsTridem == other.IsTridem || IsTridem != null && IsTridem.Equals(other.IsTridem) ) && ( HasPUP == other.HasPUP || HasPUP != null && HasPUP.Equals(other.HasPUP) ) && ( HasBellyDump == other.HasBellyDump || HasBellyDump != null && HasBellyDump.Equals(other.HasBellyDump) ) && ( HasRockBox == other.HasRockBox || HasRockBox != null && HasRockBox.Equals(other.HasRockBox) ) && ( HasHiliftGate == other.HasHiliftGate || HasHiliftGate != null && HasHiliftGate.Equals(other.HasHiliftGate) ) && ( IsWaterTruck == other.IsWaterTruck || IsWaterTruck != null && IsWaterTruck.Equals(other.IsWaterTruck) ) && ( HasSealcoatHitch == other.HasSealcoatHitch || HasSealcoatHitch != null && HasSealcoatHitch.Equals(other.HasSealcoatHitch) ) && ( RearAxleSpacing == other.RearAxleSpacing || RearAxleSpacing != null && RearAxleSpacing.Equals(other.RearAxleSpacing) ) && ( FrontTireSize == other.FrontTireSize || FrontTireSize != null && FrontTireSize.Equals(other.FrontTireSize) ) && ( FrontTireUOM == other.FrontTireUOM || FrontTireUOM != null && FrontTireUOM.Equals(other.FrontTireUOM) ) && ( FrontAxleCapacity == other.FrontAxleCapacity || FrontAxleCapacity != null && FrontAxleCapacity.Equals(other.FrontAxleCapacity) ) && ( RearAxleCapacity == other.RearAxleCapacity || RearAxleCapacity != null && RearAxleCapacity.Equals(other.RearAxleCapacity) ) && ( LegalLoad == other.LegalLoad || LegalLoad != null && LegalLoad.Equals(other.LegalLoad) ) && ( LegalCapacity == other.LegalCapacity || LegalCapacity != null && LegalCapacity.Equals(other.LegalCapacity) ) && ( LegalPUPTareWeight == other.LegalPUPTareWeight || LegalPUPTareWeight != null && LegalPUPTareWeight.Equals(other.LegalPUPTareWeight) ) && ( LicencedGVW == other.LicencedGVW || LicencedGVW != null && LicencedGVW.Equals(other.LicencedGVW) ) && ( LicencedGVWUOM == other.LicencedGVWUOM || LicencedGVWUOM != null && LicencedGVWUOM.Equals(other.LicencedGVWUOM) ) && ( LicencedTareWeight == other.LicencedTareWeight || LicencedTareWeight != null && LicencedTareWeight.Equals(other.LicencedTareWeight) ) && ( LicencedPUPTareWeight == other.LicencedPUPTareWeight || LicencedPUPTareWeight != null && LicencedPUPTareWeight.Equals(other.LicencedPUPTareWeight) ) && ( LicencedLoad == other.LicencedLoad || LicencedLoad != null && LicencedLoad.Equals(other.LicencedLoad) ) && ( LicencedCapacity == other.LicencedCapacity || LicencedCapacity != null && LicencedCapacity.Equals(other.LicencedCapacity) ) && ( BoxLength == other.BoxLength || BoxLength != null && BoxLength.Equals(other.BoxLength) ) && ( BoxWidth == other.BoxWidth || BoxWidth != null && BoxWidth.Equals(other.BoxWidth) ) && ( BoxHeight == other.BoxHeight || BoxHeight != null && BoxHeight.Equals(other.BoxHeight) ) && ( BoxCapacity == other.BoxCapacity || BoxCapacity != null && BoxCapacity.Equals(other.BoxCapacity) ) && ( TrailerBoxLength == other.TrailerBoxLength || TrailerBoxLength != null && TrailerBoxLength.Equals(other.TrailerBoxLength) ) && ( TrailerBoxWidth == other.TrailerBoxWidth || TrailerBoxWidth != null && TrailerBoxWidth.Equals(other.TrailerBoxWidth) ) && ( TrailerBoxHeight == other.TrailerBoxHeight || TrailerBoxHeight != null && TrailerBoxHeight.Equals(other.TrailerBoxHeight) ) && ( TrailerBoxCapacity == other.TrailerBoxCapacity || TrailerBoxCapacity != null && TrailerBoxCapacity.Equals(other.TrailerBoxCapacity) )); }