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