public void BuyStock(SalesPerson person, string item, int quantity) { _stock.AddOrUpdate(item, quantity, (key, oldValue) => oldValue + quantity); Interlocked.Add(ref _totalQuantityBought, quantity); _toDoQueue.AddTrade(new Trade(person, -quantity)); }
public Trade(SalesPerson person, int quantitySold) { this.Person = person; this.QuantitySold = quantitySold; }