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