using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using PARR.DAL;
using PARR.MockData;
using PARR.MockData.Services;
using Serilog;

var esppImporter = new EsppDataImporter();
esppImporter.Import();

IHost host = Host.CreateDefaultBuilder(args)
    .ConfigureServices((hostContext, services) =>
    {
        services.AddDalServices(hostContext.Configuration);
        services.AddSingleton<ITemplatesInitializer, TemplatesInitializer>();

    })
    .UseSerilog((hostContext, services, config) =>
    {
        config
            .WriteTo.Console()
            .ReadFrom.Configuration(hostContext.Configuration);
    })
    .Build();

//host.Run();

var tempInitializer = host.Services.GetRequiredService<ITemplatesInitializer>();
await tempInitializer.InitAsync();
await host.StopAsync();



