Update Path for Virto Commerce 3.400

After updating platform NuGet packages to version 3.400, you may receive compilation warnings like the following:

Warning CS0618 'SettingsExtension.GetValueAsync<T>(ISettingsManager, string, T)' is obsolete: 'Use GetValueAsync<>(SettingDescriptor)'

To fix this, you should pass the setting descriptor to the GetValueAsync() instead of the setting name and default value.

Before:
var sendDiagnosticData = settingsManager.GetValue(Setup.SendDiagnosticData.Name, (bool)Setup.SendDiagnosticData.DefaultValue);

After:
var sendDiagnosticData = settingsManager.GetValue<bool>(Setup.SendDiagnosticData);

1 Like