コード例 #1
0
        public async Task UpdateDCFs(DCFRequest request)
        {
            var stocks = await _stockListService.GetSortedStocks(request);

            foreach (var stock in stocks)
            {
                await _stocksRepository.DeleteDCF(stock.Symbol);

                var stockDcfs = await _dcfService.GetDividendCalendar2(stock.Symbol);

                foreach (var dcf in stockDcfs)
                {
                    var dbStockDcfs = _mapper.Map <List <Historical_discounted_cash_flow_Entity> >(dcf);
                    foreach (var dbDcf in dbStockDcfs)
                    {
                        dbDcf.Symbol = stock.Symbol;
                    }
                    await _stocksRepository.SaveDCFs(dbStockDcfs);
                }
            }
        }