начало работы с appsettings

This commit is contained in:
Мк Игорь 2023-05-02 21:07:37 +04:00
parent 4fe12b0279
commit cfeaf8ec10

View File

@ -29,7 +29,7 @@ builder.Services.AddTransient<IMessageInfoLogic, MessageInfoLogic>();
builder.Services.AddSingleton<AbstractMailWorker, MailKitWorker>();
builder.Configuration.AddJsonFile("appsettings.json");
builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
@ -41,6 +41,8 @@ builder.Services.AddSwaggerGen(c =>
var app = builder.Build();
var MailLogin = builder.Configuration.GetSection("MailLogin").Value;
var mailSender = app.Services.GetService<AbstractMailWorker>();
mailSender?.MailConfig(new MailConfigBindingModel
{