CleanArchitecture icon indicating copy to clipboard operation
CleanArchitecture copied to clipboard

Modify the template to only include solution name in the DLLs and not the namespaces

Open PilotBob opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe. Every namespace in the template includes the Solution name. This is generally not necessary. For example, the application csproj shows:

   <PropertyGroup>
        <TargetFramework>net6.0</TargetFramework>
        <RootNamespace>CleanArchTaylor.Application</RootNamespace>
        <AssemblyName>CleanArchTaylor.Application</AssemblyName>
        <ImplicitUsings>enable</ImplicitUsings>
        <Nullable>enable</Nullable>
    </PropertyGroup>

With the CleanArchTaylor solution name so the namespaces are generated like:

CleanArchTaylor.Application.blahblah

This creates some redundant information in the namespaces.

Describe the solution you'd like Do not include the SolutionName in the namespaces, however, continue to include them AssemblyName. For example, the project would look like:

   <PropertyGroup>
        <TargetFramework>net6.0</TargetFramework>
        <RootNamespace>Application</RootNamespace>
        <AssemblyName>CleanArchTaylor.Application</AssemblyName>
        <ImplicitUsings>enable</ImplicitUsings>
        <Nullable>enable</Nullable>
    </PropertyGroup>

and namespaces would be adjusted accordingly.

As a bonus, add a CompanyName property to the template parameters, so given the solution/app named CleanArchTaylor we could provide a company name which would create an assembly name such as:

Company.CleanArchTaylor.Application.dll

Describe alternatives you've considered I manually make these adjustments after creating a new solution. So, this would be a "nice to have" only.

Additional context Add any other context or screenshots about the feature request here.

PilotBob avatar Jun 24 '22 17:06 PilotBob

@PilotBob Please advice how you change the project name and namespaces. do you have a special way of doing that?

AbuHelweh avatar Jul 03 '22 08:07 AbuHelweh

@PilotBob Please advice how you change the project name and namespaces. do you have a special way of doing that?

Search and replace. :)

PilotBob avatar Jul 05 '22 19:07 PilotBob

I like the idea, but for now, I'll stick with the current approach as it is aligned with current conventions.

jasontaylordev avatar Jun 13 '23 21:06 jasontaylordev