using Distribution.Data; using Distribution.Features.Order; using Distribution.Features.Region; using Distribution.Features.Route; using Distribution.Features.Store; using Distribution.Features.Vehicle; using Distribution.Features.Warehouse; using Distribution.Infra.UoW; using Microsoft.EntityFrameworkCore; using MySql.EntityFrameworkCore.Extensions; var builder = WebApplication.CreateBuilder(args); var connectionString = builder.Configuration.GetConnectionString("DefaultConnection") ?? throw new InvalidOperationException("Connection string 'DefaultConnection' was not found."); builder.Services.AddDbContext(options => options.UseMySQL(connectionString)); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddControllers(); builder.Services.AddOpenApi(); var app = builder.Build(); if (app.Environment.IsDevelopment()) { app.MapOpenApi(); } app.UseHttpsRedirection(); app.UseAuthorization(); app.MapControllers(); app.Run();