From cfeaf8ec10dee13069844296d9d690d5f8b0afe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=BA=20=D0=98=D0=B3=D0=BE=D1=80=D1=8C?= Date: Tue, 2 May 2023 21:07:37 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BD=D0=B0=D1=87=D0=B0=D0=BB=D0=BE=20=D1=80?= =?UTF-8?q?=D0=B0=D0=B1=D0=BE=D1=82=D1=8B=20=D1=81=20appsettings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BlacksmithWorkshop/BlacksmithWorkshopRestAPI/Program.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/BlacksmithWorkshop/BlacksmithWorkshopRestAPI/Program.cs b/BlacksmithWorkshop/BlacksmithWorkshopRestAPI/Program.cs index 24c0f99..c1b71ad 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopRestAPI/Program.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopRestAPI/Program.cs @@ -29,7 +29,7 @@ builder.Services.AddTransient(); builder.Services.AddSingleton(); - +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(); mailSender?.MailConfig(new MailConfigBindingModel {