Browse Source

update comment

pull/21744/head
liangshiwei 2 years ago
parent
commit
457cddd6cf
  1. 7
      framework/src/Volo.Abp.Settings/Volo/Abp/Settings/AbpSettingOptions.cs
  2. 2
      framework/src/Volo.Abp.Settings/Volo/Abp/Settings/SettingEncryptionService.cs

7
framework/src/Volo.Abp.Settings/Volo/Abp/Settings/AbpSettingOptions.cs

@ -12,15 +12,16 @@ public class AbpSettingOptions
public HashSet<string> DeletedSettings { get; }
/// <summary>
/// If set to true, returns the original value if the decryption fails. Otherwise, returns empty.
/// Default: true.
/// This is useful when you change <see cref="SettingDefinition.IsEncrypted"/> of an existing setting definition to true and don't want to lose the original value.
/// </summary>
public bool ReturnOrginalValueIfDecryptFailed { get; set; }
public bool ReturnOriginalValueIfDecryptFailed { get; set; }
public AbpSettingOptions()
{
DefinitionProviders = new TypeList<ISettingDefinitionProvider>();
ValueProviders = new TypeList<ISettingValueProvider>();
DeletedSettings = new HashSet<string>();
ReturnOrginalValueIfDecryptFailed = true;
ReturnOriginalValueIfDecryptFailed = true;
}
}

2
framework/src/Volo.Abp.Settings/Volo/Abp/Settings/SettingEncryptionService.cs

@ -43,7 +43,7 @@ public class SettingEncryptionService : ISettingEncryptionService, ITransientDep
}
catch (Exception e)
{
if (Options.Value.ReturnOrginalValueIfDecryptFailed)
if (Options.Value.ReturnOriginalValueIfDecryptFailed)
{
Logger.LogWarning(e, "Failed to decrypt the setting: {0}. Returning the original value...", settingDefinition.Name);
return encryptedValue;

Loading…
Cancel
Save