/// <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 :) hashCode = hashCode * 59 + QuoteCurrency.GetHashCode(); hashCode = hashCode * 59 + Kind.GetHashCode(); if (TickSize != null) { hashCode = hashCode * 59 + TickSize.GetHashCode(); } if (ContractSize != null) { hashCode = hashCode * 59 + ContractSize.GetHashCode(); } if (IsActive != null) { hashCode = hashCode * 59 + IsActive.GetHashCode(); } hashCode = hashCode * 59 + OptionType.GetHashCode(); if (MinTradeAmount != null) { hashCode = hashCode * 59 + MinTradeAmount.GetHashCode(); } if (InstrumentName != null) { hashCode = hashCode * 59 + InstrumentName.GetHashCode(); } hashCode = hashCode * 59 + SettlementPeriod.GetHashCode(); if (Strike != null) { hashCode = hashCode * 59 + Strike.GetHashCode(); } hashCode = hashCode * 59 + BaseCurrency.GetHashCode(); if (CreationTimestamp != null) { hashCode = hashCode * 59 + CreationTimestamp.GetHashCode(); } if (ExpirationTimestamp != null) { hashCode = hashCode * 59 + ExpirationTimestamp.GetHashCode(); } return(hashCode); } }
public override int GetHashCode() { var hashCode = 1689275518; hashCode = hashCode * -1521134295 + Difference.GetHashCode(); hashCode = hashCode * -1521134295 + IsCurrentPriceIncreasing.GetHashCode(); hashCode = hashCode * -1521134295 + IsDifferencePositive.GetHashCode(); hashCode = hashCode * -1521134295 + CurrentPriceBid.GetHashCode(); hashCode = hashCode * -1521134295 + CurrentPriceAsk.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(CurrentPrice); hashCode = hashCode * -1521134295 + TickSize.GetHashCode(); hashCode = hashCode * -1521134295 + Rounding.GetHashCode(); return(hashCode); }