using SushiBarBusinessLogic.BusinessLogics; using SushiBarBusinessLogic.MailWorker; using SushiBarContracts.BindingModels; using SushiBarContracts.BusinessLogicsContracts; using SushiBarContracts.StoragesContracts; using SushiBarDatabaseImplement.Implements; using static Org.BouncyCastle.Math.EC.ECCurve; var builder = WebApplication.CreateBuilder(args); builder.Logging.SetMinimumLevel(LogLevel.Information); builder.Logging.AddLog4Net("log4net.config"); // Add services to the container. builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddControllers(); // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); var app = builder.Build(); MailConfigBindingModel? mailSender = builder.Configuration.GetSection("MailConfigBindingModel").Get(); app.Services.GetService()?.MailConfig(mailSender!); // Configure the HTTP request pipeline. if (app.Environment.IsDevelopment()) { app.UseSwagger(); app.UseSwaggerUI(); } app.UseAuthorization(); app.MapControllers(); app.Run();