
using Autofac;
using Autofac.Extensions.DependencyInjection;
using e_suite.Scheduler;
using e_suite.Scheduler.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;

var hostBuilder = new HostBuilder()
    .UseServiceProviderFactory(new AutofacServiceProviderFactory())
    .ConfigureContainer<ContainerBuilder>(builder =>
        {
            builder.RegisterModule(new CoreRegistrationModule());
        }
    )
    // Add configuration, logging, ...
    .ConfigureServices((hostContext, services) =>
    {
        // Add your services with dependency injection.
        services
            .AddLogging(loggerBuilder =>
            {
                loggerBuilder.ClearProviders();
                loggerBuilder.AddConsole();
            });

        services.AddHostedService<TimedHostedService>();
    });

hostBuilder.Build().Run();