You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
938 B
C#
24 lines
938 B
C#
using JetBrains.Annotations;
|
|
using Volo.Abp.Settings;
|
|
|
|
namespace NPin.Framework.SettingManagement.Domain.Provider.Extensions;
|
|
|
|
public static class GlobalSettingManagerExtensions
|
|
{
|
|
public static Task<string?> GetOrNullGlobalAsync(this ISettingManager settingManager, [NotNull] string name,
|
|
bool fallback = true)
|
|
{
|
|
return settingManager.GetOrNullAsync(name, GlobalSettingValueProvider.ProviderName, null, fallback);
|
|
}
|
|
|
|
public static Task<List<SettingValue>> GetAllGlobalAsync(this ISettingManager settingManager, bool fallback = true)
|
|
{
|
|
return settingManager.GetAllAsync(GlobalSettingValueProvider.ProviderName, null, fallback);
|
|
}
|
|
|
|
public static Task SetGlobalAsync(this ISettingManager settingManager, [NotNull] string name,
|
|
string? value)
|
|
{
|
|
return settingManager.SetAsync(name, value, GlobalSettingValueProvider.ProviderName, null);
|
|
}
|
|
} |