internal void Update(CurrencyModel currency, decimal value) { var bal = this.FirstOrDefault(_ => _.Currency.Id == currency.Id); if (bal == null) { this.Add(new ValueUnit(currency.ToReferenceView(), value)); } else { bal.Value += value; } }
internal virtual void Update(TKey key, CurrencyModel currency, decimal value) { if (!this.ContainsKey(key)) { var collection = new ValueUnitCollection(); collection.Add(new ValueUnit(currency.ToReferenceView(), value)); this.Add(key, collection); } else { this[key].Update(currency, value); } }