Esempio n. 1
0
 public void AddStock(Stock stock)
 {
     if (!(Stocks.Exists(s => s.Symbol == stock.Symbol)))            //If doesn't exist, add stock to list.
     {
         Stocks.Add(stock);
     }
 }
Esempio n. 2
0
 public void RemoveStock(Stock stock)
 {
     if (Stocks.Exists(s => s.Symbol == stock.Symbol))            //If does exist, remove stock from list.
     {
         var StockToRemove = Stocks.Find(s => s.Symbol == stock.Symbol);
         Stocks.Remove(StockToRemove);
     }
 }