/// <summary> /// Returns true if Instrument instances are equal /// </summary> /// <param name="other">Instance of Instrument to be compared</param> /// <returns>Boolean</returns> public bool Equals(Instrument other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( QuoteCurrency == other.QuoteCurrency || QuoteCurrency.Equals(other.QuoteCurrency) ) && ( Kind == other.Kind || Kind.Equals(other.Kind) ) && ( TickSize == other.TickSize || TickSize != null && TickSize.Equals(other.TickSize) ) && ( ContractSize == other.ContractSize || ContractSize != null && ContractSize.Equals(other.ContractSize) ) && ( IsActive == other.IsActive || IsActive != null && IsActive.Equals(other.IsActive) ) && ( OptionType == other.OptionType || OptionType.Equals(other.OptionType) ) && ( MinTradeAmount == other.MinTradeAmount || MinTradeAmount != null && MinTradeAmount.Equals(other.MinTradeAmount) ) && ( InstrumentName == other.InstrumentName || InstrumentName != null && InstrumentName.Equals(other.InstrumentName) ) && ( SettlementPeriod == other.SettlementPeriod || SettlementPeriod.Equals(other.SettlementPeriod) ) && ( Strike == other.Strike || Strike != null && Strike.Equals(other.Strike) ) && ( BaseCurrency == other.BaseCurrency || BaseCurrency.Equals(other.BaseCurrency) ) && ( CreationTimestamp == other.CreationTimestamp || CreationTimestamp != null && CreationTimestamp.Equals(other.CreationTimestamp) ) && ( ExpirationTimestamp == other.ExpirationTimestamp || ExpirationTimestamp != null && ExpirationTimestamp.Equals(other.ExpirationTimestamp) )); }