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 {