Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions DatabaseProjectAPI/Services/StockQuoteBackgroundService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ private async Task FetchAndSaveStockDataAsync(DpapiDbContext dbContext, IApiRequ

try
{
// Resolve the AlphaVantageService within the existing scope
//Resolve the AlphaVantageService within the existing scope
var stockService = _serviceProvider.GetRequiredService<IAlphaVantageService>();

// Fetch data from the API
//Fetch data from the API
var stockQuote = await stockService.GetStockQuoteAsync(symbol);

// Check if there's an existing entry in `Stocks` for this tracked stock
//Check if there's an existing entry in `Stocks` for this tracked stock
var stock = await dbContext.Stocks
.FirstOrDefaultAsync(s => s.TrackedStockId == trackedStock.Id, cancellationToken);

Expand Down