Exemplo n.º 1
0
        public async Task <PagingResultEnvelope <StockModel> > GetStocksFromWatchList(int watchListId, PagingParam pagingParam)
        {
            var result = await watchListRepository.GetWatchList();

            if (!result.Any())
            {
                // create a default watch list if there aren't any
                await NewWatchList(new NewWatchListModel
                {
                    Name   = "Default",
                    Stocks = new List <string>()
                });
            }
            return(await watchListRepository.GetStocksFromWatchlist(watchListId, pagingParam));
        }
        public WatchListCollection()
        {
            db         = new WatchListContext();
            watchLists = new List <WatchList>();
            List <WatchListDto> watchListDtos = db.GetWatchList();

            foreach (WatchListDto watchListDto in watchListDtos)
            {
                watchLists.Add(new WatchList()
                {
                    MovieID = watchListDto.MovieID
                });
            }
        }