EntityFramework-Reverse-POCO-Code-First-Generator icon indicating copy to clipboard operation
EntityFramework-Reverse-POCO-Code-First-Generator copied to clipboard

Adding the Folder Name to Project Namespaces only for POCO generated Entities & Interface

Open rajukumar-jha opened this issue 2 years ago • 5 comments

Hi @sjh37 When we generate Database.tt file we get the Entities & Interface Folders with respective files too.

But somehow the Folder name is not getting attached to the Namespace like how it does for the Controllers (Eg:- namespace ProjectName.Controllers).

To help you understand better the scenario I am attaching the screenshot.

Can you please help me where exactly shall I edit in my Database.tt file to get it working as expected.

Let me know if you have any further queries of any clarification needed. Thanks

image

rajukumar-jha avatar Mar 21 '23 10:03 rajukumar-jha

Hi, That missing folder for the namespace is actually on purpose, as all the entities, controllers, etc, are all in the same namespace and don't require extra using to be setup by you. Let me know if you still would like it set.

sjh37 avatar Mar 21 '23 19:03 sjh37

Hi @sjh37, We are following the Clean Architecture pattern and we are keeping the Entities, Interface and Data Context folder in a separate class library with respective folders and only it's referencing is used in other Class Libraries containing Repository & Controllers. Please suggest a possible way to add the folder Name to namespaces.

Also, could you please suggest if there's any way to restrict from Other Team Members the Database.tt File? I mean only people who have license on their machine can only Open the Database.tt file and not everyone.

Thanking you in anticipation.

rajukumar-jha avatar Mar 22 '23 04:03 rajukumar-jha

Hi,

  1. I will leave this case open so I can add the namespace for you. However, it could possibly be a month before I can get to this.
  2. You can't restrict people from opening any T4 template file on their computer. A developer running the T4 template without a licence will default to a Trial licence.

sjh37 avatar Mar 22 '23 09:03 sjh37

Hi,

Thank you! Please add the namespace and update us.

rajukumar-jha avatar Mar 24 '23 05:03 rajukumar-jha

Hello @sjh37 Do we have an update on my above query, please? Appreciate your support

rajukumar-jha avatar Jul 07 '23 10:07 rajukumar-jha