using Microsoft.Extensions.Configuration; using Volo.Abp.DependencyInjection; using Volo.Abp.Settings; namespace NPin.Framework.SettingManagement.Domain.Provider; public class ConfigurationSettingManagementProvider: ISettingManagementProvider, ITransientDependency { public string Name => ConfigurationSettingValueProvider.ProviderName; protected IConfiguration Configuration { get; } public ConfigurationSettingManagementProvider(IConfiguration configuration) { Configuration = configuration; } public virtual Task GetOrNullAsync(SettingDefinition setting, string providerKey) { return Task.FromResult(Configuration[ConfigurationSettingValueProvider.ConfigurationNamePrefix + setting.Name]); } public Task SetAsync(SettingDefinition setting, string value, string providerKey) { throw new AbpException($"Can not set a setting value to the application configuration."); } public Task ClearAsync(SettingDefinition setting, string providerKey) { throw new AbpException($"Can not clear provider to the application configuration."); } }