Program.cs 417 B

1234567891011121314151617
  1. IHost host = Host.CreateDefaultBuilder(args)
  2. .UseWindowsService()
  3. .ConfigureServices((hostContext, services) => {
  4. IConfiguration configuration = hostContext.Configuration;
  5. services.AddHostedService<Worker>();
  6. services.ConfigurePgSqlContext(configuration);
  7. services.AddSingleton<UpdateOperations>();
  8. services.AddScoped<IRepositoryWrapper, RepositoryWrapper>();
  9. })
  10. .Build();
  11. await host.RunAsync();