예제 #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);
     }
 }
예제 #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);
     }
 }