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