using SIGCM.Infrastructure; using SIGCM.Infrastructure.Data; var builder = WebApplication.CreateBuilder(args); // Add services to the container. builder.Services.AddControllers(); builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); builder.Services.AddInfrastructure(); var app = builder.Build(); // Configure the HTTP request pipeline. if (app.Environment.IsDevelopment()) { app.UseSwagger(); app.UseSwaggerUI(); } app.UseHttpsRedirection(); app.UseAuthorization(); app.MapControllers(); // Initialize DB using (var scope = app.Services.CreateScope()) { var initializer = scope.ServiceProvider.GetRequiredService(); await initializer.InitializeAsync(); } app.Run();