Skip to content
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

Merged
merged 2 commits into from
Nov 20, 2020
Merged

Fix add user secrets #44838

merged 2 commits into from
Nov 20, 2020

Conversation

galakt
Copy link
Contributor

@galakt galakt commented Nov 17, 2020

Fixes #44150

@ghost
Copy link

ghost commented Nov 17, 2020

Tagging subscribers to this area: @maryamariyan
See info in area-owners.md if you want to be subscribed.

Issue Details
Description:

Fixes #44150

Author: galakt
Assignees: -
Labels:

area-Extensions-Configuration

Milestone: -

@galakt
Copy link
Contributor Author

galakt commented Nov 19, 2020

@maryamariyan @safern ping

@maryamariyan
Copy link
Member

@galakt thanks for the PR. will take a look

Copy link
Member

@maryamariyan maryamariyan left a 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());
Copy link
Member

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.

@maryamariyan maryamariyan merged commit 5301748 into dotnet:master Nov 20, 2020
@@ -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);
Copy link
Member

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.

Copy link
Member

@safern safern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@galakt galakt deleted the FixAddUserSecrets branch November 20, 2020 21:41
@ghost ghost locked as resolved and limited conversation to collaborators Dec 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AddUserSecrets optional parameter not working as expected
4 participants