public BackupController(IOptionsMonitor <ServiceOptions> options, IHostedService hostedService, ILogger <BackupController> logger, ServiceDb serviceDb, IHostingEnvironment env) : base(env) { this.serviceOptions = options.CurrentValue; options.OnChangeWithDelay((opt) => this.serviceOptions = opt); this.log = logger; this.serviceDb = serviceDb; this.schedulerService = hostedService as SchedulerService; //this.serviceDb.Database.EnsureCreated(); }
public LibraryController(/*SchedulerService schedulerService ,*/ IWebHostEnvironment env, IOptions <MusicServerOptions> mso, /*IServiceProvider sp,*/ TaskPublisher tp, TaskRunner tr, IOptionsMonitor <MusicOptions> mo, ILogger <LibraryController> logger, MusicDb mdb) : base(logger, env) { this.musicOptions = mo.CurrentValue; //this.ss = schedulerService;// hs as SchedulerService; mo.OnChangeWithDelay((opt) => { this.musicOptions = opt; }); this.contentRootPath = env.ContentRootPath; this.log = logger; this.musicServerOptions = mso.Value; this.musicDb = mdb; this.taskPublisher = tp; this.taskRunner = tr; }
public DeviceManagerFactory(IHostingEnvironment env, IOptionsMonitor <PlayerConfiguration> playerConfigurationOptions, IHostedService hs, ILoggerFactory lf) { this.env = env; this.schedulerService = hs as SchedulerService; managers = new Dictionary <DeviceIdentifier, DeviceManager>(new DeviceComparer()); loggerFactory = lf; log = loggerFactory.CreateLogger <DeviceManagerFactory>(); musicServerUrl = null; this.playerConfiguration = playerConfigurationOptions.CurrentValue; playerConfigurationOptions.OnChangeWithDelay((opt) => { this.playerConfiguration = opt; foreach (var item in managers) { item.Value.ReplacePlayConfiguration(this.playerConfiguration); } }); }