mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 14:34:23 +01:00
Allow resolution of any settings via DI
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user