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 //Update all handled shares
foreach (var stock in CurrentStocks) foreach (var stock in CurrentStocks)
{ {
stock.ActValue = Stocks[stock.StockId.Trim()].LatestPrice; if (Stocks.ContainsKey(stock.StockId.Trim()))
stock.ActDate = DateTime.Today; {
_stockRepository.UpdateActualPrice(stock.Id, stock.ActValue); stock.ActValue = Stocks[stock.StockId.Trim()].LatestPrice;
tmpStocks.Add(stock); stock.ActDate = DateTime.Today;
_stockRepository.UpdateActualPrice(stock.Id, stock.ActValue);
tmpStocks.Add(stock);
}
} }
//Use only Stocks belonging to person //Use only Stocks belonging to person
var connects =_stockPersonConnect.GetAllConnectionsByPersId(ConnectedPerson.Id); var connects =_stockPersonConnect.GetAllConnectionsByPersId(ConnectedPerson.Id);