public void AddStock(Stock stock) { if (!(Stocks.Exists(s => s.Symbol == stock.Symbol))) //If doesn't exist, add stock to list. { Stocks.Add(stock); } }
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); } }