示例#1
0
        public List <WatchListGroup> GetAllWatchList()
        {
            var watchList  = _watchListRepository.GetAllWatchList();
            var stockPrice = _stockService.GetLatestStockHistory();

            foreach (var group in watchList)
            {
                foreach (var groupWatchList in group.WatchLists)
                {
                    var stock = stockPrice[groupWatchList.StockCode];
                    if (stock != null)
                    {
                        groupWatchList.Last = stock.Last;
                        groupWatchList.Open = stock.Open;
                    }
                }
            }

            return(watchList);
        }