private void ConfigureRepricerService(IServiceCollection services) { services.Configure <RepriceLoggingConfiguration>(Configuration.GetSection("RepriceLogging")); var config = GetRepriceLoggingConfiguration(); var repriceLogger = new RepriceLogger(config); services.AddSingleton(typeof(IRepriceLogger), repriceLogger); // Cache services.AddSingleton(typeof(IRepriceCache), new RepriceCache()); // Logger worker var logWorker = new RepriceLogWorker(repriceLogger); services.AddSingleton(typeof(IRepriceLogWorker), logWorker); logWorker.Start(config.CreateEveryXSeconds * 1000); }