public void Handle(RemoveFromHigh message) { var price = _highPrices[message.PriceId]; _highPrices.Remove(message.PriceId); if (price <= _positionPrice) return; if (_highPrices.Count == 0 || _highPrices.Values.All(x => x >= price)) { _positionPrice = price; } }
public bool Equals(RemoveFromHigh other) { if (ReferenceEquals(null, other)) { return false; } if (ReferenceEquals(this, other)) { return true; } return other.PriceId.Equals(PriceId); }