Esempio n. 1
0
        public static IHostBuilder CreateHostBuilder(string[] args) =>
        Host.CreateDefaultBuilder(args)
        .UseSystemd()
        .ConfigureServices((hostContext, services) =>
        {
            IConfiguration configuration = hostContext.Configuration;
            SettingsOptions options      = configuration.GetSection("Settings").Get <SettingsOptions>();

            services.AddSingleton(options);
            services.AddHostedService <Worker>();
        });
Esempio n. 2
0
 public Worker(ILogger <Worker> logger, SettingsOptions options)
 {
     _logger   = logger;
     _options  = options;
     _measures = new List <Measure>();
 }