/// <summary> /// Returns true if MarketDataFilter instances are equal /// </summary> /// <param name="other">Instance of MarketDataFilter to be compared</param> /// <returns>Boolean</returns> public bool Equals(MarketDataFilter other) { // credit: http://stackoverflow.com/a/10454552/677735 if (other == null) { return(false); } return((LadderLevels == other.LadderLevels || LadderLevels != null && LadderLevels.Equals(other.LadderLevels)) && (Fields == other.Fields || Fields != null && Fields.SequenceEqual(other.Fields))); }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { // credit: http://stackoverflow.com/a/263416/677735 unchecked // Overflow is fine, just wrap { var hash = 41; // Suitable nullity checks etc, of course :) if (LadderLevels != null) { hash = hash * 59 + LadderLevels.GetHashCode(); } if (Fields != null) { hash = hash * 59 + Fields.GetHashCode(); } return(hash); } }