[Feature] Add possibility to mention full namespace for entities location
See original GitHub issueHi!
I have the following scenario: Generating the table structure (Entities) in one project, and generating the DbContext and configuration files in another project. The result of this approach is that the context and configuration files need a reference to the namespace where the entity files are located.
I tried using the EntityTypes sub-namespace
feature, but this just appends the input namespace to the destination project’s own namespace - which I assume is what it is meant to do.
The only solution I currently have is to manually edit the DbContext and configuration files to add the reference to where the entities are located.
It would be nice to be allowed to specify exactly where the entities are or will be located so that their full namespace can be added to the generated context and configuration files, without the need to manually edit them.
I know you already heard this a lot, but this extension is such an time-saver, thank you very much for doing this!
If you need extra print screens or other details, I’ll happily provide them.
Further technical details
EF Core Power Tools version: 2.4.217.0
Database engine: SQL Server 2016
Visual Studio version: Visual Studio 2019 v. 16.4.2
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (5 by maintainers)
Top GitHub Comments
That is where I came up with the idea to use the handlebars. The second time I looked after you mentioned handlebars are not required, I noticed a link to this same issue someone else mentioned and that’s where I found the following solution: Top namespace input should be the common namespace part for the two projects. Then specify in the
EntityTypes sub-namespace
input the rest of the namespace to where your entities are located and in theDbContext sub-namespace
input the rest for theDbContext
location. This results in the concatenation of the common namespace part and theEntity
namespace in ausing
statement which will be injected in the generated context and configuration files.Would be great if you could provide more details with a sample perhaps?