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

            services.AddSingleton(options);
            services.AddHostedService <Worker>();
        });
Esempio n. 2
0
 public Worker(ILogger <Worker> logger, CrawlConfig settings)
 {
     _logger          = logger;
     this.CrawlConfig = settings;
 }