First off, let’s agree that namespace should match folder structure and that each language artefact should be in its own file.
(see Should the folders in a solution ma
12 Years on, is there any definitive or best practice answer on this question?
I would like to use the Nested folders structure, however given that you:
"agree that namespace should match folder structure and that each language artefact should be in its own file."
How would project A.B.C.csproj folder structure look if it extended code from other namespaces, for example:
Perhaps something like:
/A // namespace: A
/B // namespace: A.B
/C // namespace: A.B.C
A.B.C.csproj
ClassC.cs
/_ // External Namespace root folder (underscore with no text)
/System // namespace: System
/Linq // namespace: System.Linq
IQueryableExtensions.cs
/Microsoft // namespace: Microsoft
/Extensions // namespace: Microsoft.Extensions
/Logging // namespace: Microsoft.Extensions.Logging
ILoggerExtensions.cs
/__A // namespace: A (Grand Parent folder (2 underscores for 2 levels up)
ClassAExtensions.cs
/B // namespace: A.B (Nested Parent folder)
ClassBExtensionsNested.cs
//Parent Namespace folder (1 underscore for 1 level up)
/_B // namespace: A.B
ClassBExtensions.cs
/D // namespace: A.B.C.D (Child folder)
ClassDExtensions.cs
Above is trying to demonstrate: