35 lines
1.2 KiB
C#
35 lines
1.2 KiB
C#
using PARR.GeneratorTemplates;
|
|
using PARR.GeneratorTemplatesWorker;
|
|
using Serilog;
|
|
|
|
|
|
IHost host = Host.CreateDefaultBuilder(args)
|
|
.ConfigureServices((hostContext, services) =>
|
|
{
|
|
services.InstallGeneratorTemplateServices(hostContext.Configuration);
|
|
//hostContext.Configuration.AddGeneratorTemplateConfigurations(services);
|
|
//services.AddGeneratorTemplateSettings(hostContext.Configuration);
|
|
|
|
//services.AddHostedService<Worker>();
|
|
})
|
|
//.ConfigureAppConfiguration((hostContext, configBuilder) =>
|
|
//{
|
|
//TODO: !!! !!! !!! не смог прикрутить AddGeneratorTemplateConfigurations, не могу прокинуть туда сервисы
|
|
// configBuilder.AddGeneratorTemplateConfigurations(hostContext.Services);
|
|
//})
|
|
.ConfigureServices((hostContext, services) =>
|
|
{
|
|
//services.AddGeneratorTemplateSettings(hostContext.Configuration);
|
|
|
|
services.AddHostedService<Worker>();
|
|
})
|
|
.UseSerilog((hostContext, services, config) =>
|
|
{
|
|
config
|
|
.WriteTo.Console()
|
|
.ReadFrom.Configuration(hostContext.Configuration);
|
|
})
|
|
.Build();
|
|
|
|
host.Run();
|