public void UpdateCurrencyAmount(string currency, double amount) { var mutable = CurrencyAmounts.ToDictionary(x => x.Key, x => x.Value); mutable[currency] += amount; CurrencyAmounts = mutable.ToImmutableDictionary <string, double>(); }
private void OnSerializing(StreamingContext context) { _LatestTrades = LatestTrades.ToArray(); _CurrencyAmounts = CurrencyAmounts.ToDictionary(x => x.Key, x => x.Value); }