diff --git a/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/SettingProvider.cs b/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/SettingProvider.cs index 401a527b1f..bceaed9983 100644 --- a/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/SettingProvider.cs +++ b/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/SettingProvider.cs @@ -73,6 +73,10 @@ namespace Volo.Abp.Settings } settingDefinitions.RemoveAll(x => notNullValues.Any(v => v.Name == x.Name)); + if (!settingDefinitions.Any()) + { + break; + } } return result.Values.ToList(); diff --git a/modules/setting-management/test/Volo.Abp.SettingManagement.Tests/Volo/Abp/SettingManagement/SettingManager_Basic_Tests.cs b/modules/setting-management/test/Volo.Abp.SettingManagement.Tests/Volo/Abp/SettingManagement/SettingManager_Basic_Tests.cs index 1dafc31570..17b9bc70b2 100644 --- a/modules/setting-management/test/Volo.Abp.SettingManagement.Tests/Volo/Abp/SettingManagement/SettingManager_Basic_Tests.cs +++ b/modules/setting-management/test/Volo.Abp.SettingManagement.Tests/Volo/Abp/SettingManagement/SettingManager_Basic_Tests.cs @@ -46,6 +46,15 @@ namespace Volo.Abp.SettingManagement settingValues.ShouldContain(sv => sv.Name == "SettingNotSetInStore" && sv.Value == "default-value"); } + [Fact] + public async Task Should_Get_All_By_Names_Base_Store_Values() + { + var settingValues = await _settingProvider.GetAllAsync(new []{ "MySetting1", "MySetting2" }); + settingValues.Count.ShouldBe(2); + settingValues.ShouldContain(sv => sv.Name == "MySetting1" && sv.Value == "42"); + settingValues.ShouldContain(sv => sv.Name == "MySetting2" && sv.Value == "default-store-value"); + } + [Fact] public async Task Should_Set_Global_Value() {