/// <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 (Ch != null) { hashCode = hashCode * 59 + Ch.GetHashCode(); } if (Chp != null) { hashCode = hashCode * 59 + Chp.GetHashCode(); } if (Lp != null) { hashCode = hashCode * 59 + Lp.GetHashCode(); } if (Ask != null) { hashCode = hashCode * 59 + Ask.GetHashCode(); } if (Bid != null) { hashCode = hashCode * 59 + Bid.GetHashCode(); } if (OpenPrice != null) { hashCode = hashCode * 59 + OpenPrice.GetHashCode(); } if (HighPrice != null) { hashCode = hashCode * 59 + HighPrice.GetHashCode(); } if (LowPrice != null) { hashCode = hashCode * 59 + LowPrice.GetHashCode(); } if (PrevClosePrice != null) { hashCode = hashCode * 59 + PrevClosePrice.GetHashCode(); } if (Volume != null) { hashCode = hashCode * 59 + Volume.GetHashCode(); } return(hashCode); } }
/// <summary> /// Returns true if SingleQuote instances are equal /// </summary> /// <param name="other">Instance of SingleQuote to be compared</param> /// <returns>Boolean</returns> public bool Equals(SingleQuote other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Ch == other.Ch || Ch != null && Ch.Equals(other.Ch) ) && ( Chp == other.Chp || Chp != null && Chp.Equals(other.Chp) ) && ( Lp == other.Lp || Lp != null && Lp.Equals(other.Lp) ) && ( Ask == other.Ask || Ask != null && Ask.Equals(other.Ask) ) && ( Bid == other.Bid || Bid != null && Bid.Equals(other.Bid) ) && ( OpenPrice == other.OpenPrice || OpenPrice != null && OpenPrice.Equals(other.OpenPrice) ) && ( HighPrice == other.HighPrice || HighPrice != null && HighPrice.Equals(other.HighPrice) ) && ( LowPrice == other.LowPrice || LowPrice != null && LowPrice.Equals(other.LowPrice) ) && ( PrevClosePrice == other.PrevClosePrice || PrevClosePrice != null && PrevClosePrice.Equals(other.PrevClosePrice) ) && ( Volume == other.Volume || Volume != null && Volume.Equals(other.Volume) )); }