public Trade(SalesPerson person, int quantity) { this.Person = person; this.QuantitySold = quantity; }
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)); }