Ejemplo n.º 1
0
 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));
 }
Ejemplo n.º 2
0
 public Trade(SalesPerson person, int quantitySold)
 {
     this.Person       = person;
     this.QuantitySold = quantitySold;
 }