-
Notifications
You must be signed in to change notification settings - Fork 201
Conversation
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.
Subject to approval.
@@ -120,6 +120,9 @@ | |||
<data name="Common_StringNullOrEmpty" xml:space="preserve"> | |||
<value>Value cannot be null or an empty string.</value> | |||
</data> | |||
<data name="Error_EntryAssemblyNull" xml:space="preserve"> | |||
<value>This method could not find a user secret ID because the application's entry assembly is not set.</value> |
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.
Consider suggesting calling the generic version of the method.
/// <param name="configuration"></param> | ||
/// <typeparam name="TStartup">The startup class</typeparam> | ||
/// <returns></returns> | ||
public static IConfigurationBuilder AddUserSecrets<TStartup>(this IConfigurationBuilder configuration) |
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.
Isn't TStartup a bit arbitrary? I get why it is nice but I feel guilty for lying 😄 I don't feel strongly though.
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.
I don't feel strongly about the method either. But the thinking was that we would switch templates to use this. .AddUserSecrets<Startup>()
seemed cleaner than .AddUserSecrets(typeof(Startup).GetTypeInfo().Assembly)
.
FWIW as long as we're consider API for the sake of templates, may we should just template .AddUserSecrets(string userSecretId)
instead.
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.
Sorry I wasn't clear. I just meant that the method could any T to find the assembly containing the attribute, not necessarily the type of the Startup class, even if in template code we do use Startup. But it doesn't matter. TStartup is nice even uf not necessarily accurate.
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.
ah, that clarifies.
28aa150
to
b83deb3
Compare
Nevermind. We won't do the scan of assemblies. |
This patch fix is approved! |
6849f6e
to
7a7cbb3
Compare
Mitigates #543. A full fix requires templates to start using this overload instead of
.AddUserSecrets()
.Also fixes the NRE for null entry assemblies to be more user-friendly.