What is the correct place to add a database driven scheduler in ASP.NET Core?
I have added a Timer to Startup class of an ASP.Net Core application. It fires on some time period and do operations like logging a sample text. I need it to be able to do database driven operations like adding a record to a table. So I try to get AppDbContext from DI but it is always null. Please see the code: public class Scheduler { static Timer _timer; static bool _isStarted; static ILogger<Scheduler> _logger; const int dueTimeMin = 1; const int periodMin = 1; public static void Start(IServiceProvider serviceProvider) { if (_isStarted) throw new Exception("Currently is started"); _logger =