public FileService(ILogger <FileService> logger, TelemetryClient telemetryClient, RunConfig config) { _logger = logger; _config = config; _telemetryClient = telemetryClient; }
public DotNetCompressionService(ILogger <DotNetCompressionService> logger, TelemetryClient telemetryClient, RunConfig config) { _logger = logger; _telemetryClient = telemetryClient; _config = config; }
public Worker(ILogger <Worker> logger, IHostApplicationLifetime hostApplicationLifetime, TelemetryClient telemetryClient, RunConfig config, FileService fileService, DotNetCompressionService dotNetCompressionService, OtherCompressionService otherCompressionService ) { _logger = logger; _hostApplicationLifetime = hostApplicationLifetime; _telemetryClient = telemetryClient; _config = config; _fileService = fileService; _dotNetCompressionService = dotNetCompressionService; _otherCompressionService = otherCompressionService; }
public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureServices((hostContext, services) => { services.AddApplicationInsightsTelemetryWorkerService( hostContext.Configuration["APPINSIGHTS_INSTRUMENTATIONKEY"]); var runConfig = new RunConfig(); hostContext.Configuration.GetSection("RunConfig").Bind(runConfig); runConfig.RunID = Guid.NewGuid().ToString(); services.AddSingleton(runConfig); services.AddSingleton <FileService>(); services.AddSingleton <DotNetCompressionService>(); services.AddSingleton <OtherCompressionService>(); services.AddHostedService <Worker>(); });