skip to Main Content

How to perform multiple operations concurrently on DbContext? – Asp.net

I have the following background service running: protected override async Task ExecuteAsync(CancellationToken stoppingToken) { await Task.Run(async () => { while (!stoppingToken.IsCancellationRequested) { using (var scope = _scopeFactory.CreateScope()) { DataContext dbContext = scope.ServiceProvider.GetRequiredService<DataContext>(); var tasks = new List<Task>(); tasks.Add(siteA.ProcessSchedule(SportLeagues.MLB, logger, dbContext));…

VIEW QUESTION
Back To Top
Search