public async Task DeleteAsync(List <string> settingNames) { foreach (var name in settingNames) { var setting = _manager.GetOrNull(name); if (setting == null) { continue; } await _settingManager.SetForCurrentTenantAsync(name, setting.DefaultValue); } }
public virtual async Task SetSettingValues(Dictionary <string, string> settingValues) { foreach (var kv in settingValues) { // The key of the settingValues is in camel_Case, like "setting_Abp_Localization_DefaultLanguage", // change it to "Abp.Localization.DefaultLanguage" form string pascalCaseName = kv.Key.ToPascalCase(); if (!pascalCaseName.StartsWith(SettingUiConst.FormNamePrefix)) { continue; } string name = pascalCaseName.RemovePreFix(SettingUiConst.FormNamePrefix).UnderscoreToDot(); var setting = _settingDefinitionManager.GetOrNull(name); if (setting == null) { continue; } await _settingManager.SetForCurrentTenantAsync(name, kv.Value); } }