Allow resolution of any settings via DI

This commit is contained in:
nicolas.dorier
2022-05-24 13:18:16 +09:00
parent 3285f24fe9
commit 67eeb4b69a
41 changed files with 221 additions and 149 deletions

View File

@@ -1,18 +0,0 @@
using System.Threading.Tasks;
using BTCPayServer.Abstractions.Contracts;
using BTCPayServer.Services;
namespace BTCPayServer
{
public static class SettingsRepositoryExtensions
{
public static async Task<PoliciesSettings> GetPolicies(this ISettingsRepository settingsRepository)
{
return await settingsRepository.GetSettingAsync<PoliciesSettings>() ?? new PoliciesSettings();
}
public static async Task<ThemeSettings> GetTheme(this ISettingsRepository settingsRepository)
{
return await settingsRepository.GetSettingAsync<ThemeSettings>() ?? new ThemeSettings();
}
}
}