refactorisation de la configuration
This commit is contained in:
parent
838de379fd
commit
749eb645d5
7 changed files with 43 additions and 35 deletions
|
|
@ -13,17 +13,16 @@ namespace nuget_host.Controllers
|
|||
{
|
||||
private readonly ILogger _logger;
|
||||
readonly IHostingEnvironment _environment;
|
||||
public IDataProtector DataProtector { get; }
|
||||
public SmtpSettings Options { get; } //set only via Secret Manager
|
||||
public SmtpSettings _smtpSettings { get; } //set only via Secret Manager
|
||||
|
||||
public HomeController(
|
||||
IOptions<SmtpSettings> smtpSettings,
|
||||
IDataProtectionProvider provider, Microsoft.AspNetCore.Hosting.IHostingEnvironment environment, ILogger<HomeController> logger)
|
||||
IHostingEnvironment environment,
|
||||
ILogger<HomeController> logger)
|
||||
{
|
||||
_environment = environment;
|
||||
_logger = logger;
|
||||
Options = smtpSettings.Value;
|
||||
DataProtector = provider.CreateProtector(Options.ProtectionTitle);
|
||||
_smtpSettings = smtpSettings.Value;
|
||||
}
|
||||
|
||||
public IActionResult Index()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue