using Autofac;
using Autofac.Extensions.DependencyInjection;
using e_suite.Database.MigrationBuilder.DependencyInjection;
using e_suite.Database.SqlServer;

var builder = WebApplication.CreateBuilder(args);


builder.Host.UseServiceProviderFactory(new AutofacServiceProviderFactory())
    .ConfigureContainer<ContainerBuilder>(builder =>
    {
        builder.RegisterModule(new CoreRegistrationModule());
    });

// Add services to the container.

builder.AddDatabaseContext();

builder.Services.AddControllers();

var app = builder.Build();

// Configure the HTTP request pipeline.
app.UseHttpsRedirection();

app.UseAuthorization();

app.MapControllers();

app.Run();
