You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello. I have a specific use case where the models of a specific API controller are used throughout the app, and it is therefore useful to have them in the root namespace (rather than add "using" lines to every class). The EF Core PowerTools allows for custom namespaces for models. That is great. The limitation is that it only allows "sub-namespaces".
If there were a "use root" option, that would be great. In the example below, I enter "DELETE" and then search/replace it out each time I rerun Reverse Engineering.
Activity
FeraMJ commentedon Sep 22, 2022
Hello. I have a specific use case where the models of a specific API controller are used throughout the app, and it is therefore useful to have them in the root namespace (rather than add "using" lines to every class). The EF Core PowerTools allows for custom namespaces for models. That is great. The limitation is that it only allows "sub-namespaces".
If there were a "use root" option, that would be great. In the example below, I enter "DELETE" and then search/replace it out each time I rerun Reverse Engineering.
ErikEJ commentedon Sep 22, 2022
So you want the namespace for the entities to be "Codify" and the DbContext namespace should be "Codify.Areas.Core.Data" ??
ErikEJ commentedon Sep 22, 2022
I think you can leave the "Namespace" text box empty, and define an explict namespace for Entity and DbContext in the sub-namespace text boxes
FeraMJ commentedon Sep 22, 2022
You are correct. That did the job. Thanks again!
ErikEJ commentedon Sep 22, 2022
I have added this example to the docs