ASPForums.Net RSS Feed additions to the content that appears on ASPForums.Net(c) 2019 All rights reserved.ASP.Net Entity Framework Core Error: Cannot access a disposed object<p>I solved so</p> <p>this is solution: have to use IServiceProvider to give DbContext scope to Coravel</p> <pre class="brush: csharp"> using (var scope = _scopeFactory.CreateScope()) { var appDbCtx = scope.ServiceProvider.GetService&lt;ApplicationDbContext&gt;(); var companyDbCtx = scope.ServiceProvider.GetService&lt;CompanyDbContext&gt;(); foreach (var table in tables) { switch (table) { case &#34;agenti&#34;: processed += await FillAgenti(appDbCtx, companyDbCtx); break; case &#34;rubrica&#34;: processed += await FillRubrica(appDbCtx, companyDbCtx); break; ... } await _hubContext.Clients.Group(jobId).SendAsync(&#34;progress&#34;, (processed / tables.Count) * 100); }</pre> <p>&nbsp;</p> <p>&nbsp;</p>, 16 May 2019 07:37:20 GMT