-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Description
Is your feature request related to a problem? Please describe.
Not a problem, but this would improve maintainability for a moderate to large project composed from multiple libraries (both regular C# netstandard and razor libraries).
Describe the solution you'd like
Blazor's Razor markup doesn't support partial namespaces. I am building a suite of libraries and would like all of them to share a single top level namespace, say foo
. The libraries would then apply namespaces:
- Library 1:
namespace foo.bar1
with components Bish.razor, Bash.razor and Bosh.razor. - Library 2:
namespace foo.bar2
- Library 3:
namespace foo.bar3
The app consuming the libraries would then place @using foo
and use the remainder of the namespace in a component tag. So for instance using the component Bish from library 1, the markup would be <bar1.Bish ... />
.
This is geared towards maintainability and clarity of usage.
Additional context
https://docs.microsoft.com/en-us/aspnet/core/blazor/components?view=aspnetcore-3.1#import-components.