-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix add user secrets #44838
Fix add user secrets #44838
Conversation
Tagging subscribers to this area: @maryamariyan Issue Details
|
@maryamariyan @safern ping |
@galakt thanks for the PR. will take a look |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks @galakt
File.Delete(secretPath); | ||
} | ||
|
||
Assert.Throws<FileNotFoundException>(() => new ConfigurationBuilder().AddUserSecrets(Assembly.GetExecutingAssembly(), false).Build()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: ideally you'd only want to keep the method that you're asserting behavior within the Assert.Throws block.
@@ -169,6 +169,9 @@ public static IConfigurationBuilder AddUserSecrets(this IConfigurationBuilder co | |||
/// <param name="reloadOnChange">Whether the configuration should be reloaded if the file changes.</param> | |||
/// <returns>The configuration builder.</returns> | |||
public static IConfigurationBuilder AddUserSecrets(this IConfigurationBuilder configuration, string userSecretsId, bool reloadOnChange) | |||
=> AddUserSecretsInternal(configuration, userSecretsId, true, reloadOnChange); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, usually we name bool parameters. It is not a big deal, but for next time. It helps understand what the true is for when reading the call site.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fixes #44150