var Builder = WebApplication.CreateBuilder(args); Builder.Services.AddControllers(); Builder.Services.AddEndpointsApiExplorer(); Builder.Services.AddSwaggerGen(); var App = Builder.Build(); if (App.Environment.IsDevelopment()) { App.UseSwagger(); App.UseSwaggerUI(); } App.UseHttpsRedirection(); App.UseAuthorization(); App.MapControllers(); App.Run();