начало работы с appsettings
This commit is contained in:
parent
4fe12b0279
commit
cfeaf8ec10
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user