Cannot consume scoped service ‘MyDbContext’ from singleton ‘Microsoft.AspNetCore.Hosting.Internal.HostedServiceExecutor’
I’ve build a background task in my ASP.NET Core 2.1 following this tutorial: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/host/hosted-services?view=aspnetcore-2.1#consuming-a-scoped-service-in-a-background-task