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