aspnet/FileSystem

Update doc comments for EmbeddedFileProvider constructor without namespace argument

grahamehorner opened this issue · 4 comments

The EmbeddedFileProvider constructor defaultNamespace is NOT correct when the Assembly Default Namespace is not the same as the name of the assembly

> public EmbeddedFileProvider(Assembly assembly)
>             : this(assembly, assembly?.GetName()?.Name)
>         {
>         }

@grahamehorner is there a better way to get to the configured default namespace? The code here is a best effort guess that follows the SDK's convention of using the assembly name as the default namespace.

@pakrym I've wrote and extension method to IList which accepts a type and resolves both the assembly & namespace and add the EmeddedFileProvider to the IList as a solution for me; I think the constructor comment needs updated to be informative of this limitation/assumption

I think the constructor comment needs updated to be informative of this limitation/assumption

We'd be happy to accept a PR for this.

Fixed in bd96038