Problems with part-of-stocks update fixed

This commit is contained in:
2022-02-09 16:22:35 +01:00
parent f5cbe5972e
commit f214f29fdf

View File

@ -59,10 +59,13 @@ namespace StockInfoCore
//Update all handled shares
foreach (var stock in CurrentStocks)
{
stock.ActValue = Stocks[stock.StockId.Trim()].LatestPrice;
stock.ActDate = DateTime.Today;
_stockRepository.UpdateActualPrice(stock.Id, stock.ActValue);
tmpStocks.Add(stock);
if (Stocks.ContainsKey(stock.StockId.Trim()))
{
stock.ActValue = Stocks[stock.StockId.Trim()].LatestPrice;
stock.ActDate = DateTime.Today;
_stockRepository.UpdateActualPrice(stock.Id, stock.ActValue);
tmpStocks.Add(stock);
}
}
//Use only Stocks belonging to person
var connects =_stockPersonConnect.GetAllConnectionsByPersId(ConnectedPerson.Id);