Files
SocialPub/PrivaPub/Services/AppConfigurationService.cs
T

19 lines
685 B
C#
Raw Normal View History

2023-02-18 08:52:17 +01:00
using Microsoft.Extensions.Options;
2023-02-19 00:43:43 +01:00
using PrivaPub.Models;
2023-02-18 08:52:17 +01:00
2023-02-19 00:43:43 +01:00
namespace PrivaPub.Services
2023-02-18 08:52:17 +01:00
{
// The configuration as appsettings has it now. Builds before 2026-10-17 copied it into Mongo on first boot and read that
// copy forever after, so a changed SMTP account or language list never took; the copy is no longer read.
2023-02-18 08:52:17 +01:00
public class AppConfigurationService
{
readonly IOptionsMonitor<AppConfiguration> _appConfiguration;
public AppConfigurationService(IOptionsMonitor<AppConfiguration> appConfiguration) => _appConfiguration = appConfiguration;
2023-02-18 08:52:17 +01:00
public AppConfiguration AppConfiguration => _appConfiguration.CurrentValue;
2023-02-18 08:52:17 +01:00
public Task Init() => Task.CompletedTask;
2023-02-18 08:52:17 +01:00
}
}