-
-
Notifications
You must be signed in to change notification settings - Fork 298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reverse-Engineer with schemas into directories #158
Comments
Why have all your tables in a single DbContext? Why not two projects with a DbContext per schema? (You can do that today) |
Ping? |
My database has relationships between tables from different schemas. I'm unaware of a way that Entity Framework can allow joins between contexts without loading everything in memory. I think it'd be great to mirror this capability of database schemas in an EF Core context. |
Not something I plan to implement, but a PR for this will be considered |
It will be a cool feature! |
@Trigun27 PRs accepted 😀 |
@ErikEJ Hi. I think this will be a nice feature. Maybe I can try to write the required code. |
Actually, it does not look like there is any way of doing the in a generic fashion with the current implementation. This place would be a potential place to do it, but I am not sure you have any schema information at this point: https://github.com/ErikEJ/EFCorePowerTools/blob/master/src/GUI/RevEng.Core/ReverseEngineerRunner.cs#L116 |
Closing as external, must be implemented in EF Core |
Thanks for re-opening this @ErikEJ !! |
I will have another look at this, could one of you outline the desired file structure? Would it be something like:
|
Hey @ErikEJ , See attached our current setup we do manually. Hope this helps. Our schema are named scAccess, for example, in the db. The "sc" prefix is just a naming convention we have to specify the db structure is a schema. |
Hi @ErikEJ , |
I am not really able to figure out how to do this without pulling in too much EF Core code, but I added this method recently, so maybe it is within reach: https://github.com/ErikEJ/EFCorePowerTools/blob/master/src/GUI/RevEng.Core/ReverseEngineerScaffolder.cs#L227 A PR to do this would be considered! |
Hey Erik,
I assume that utilizing that mechanism won't work here because Reveng does it's own handling of the files and schemas? |
I guess the implementation could be used as inspiration? |
I took some time to investigate this part in the latest code, and I found that for the Stored Procedures and Functions it is easy to introduce this change, I can say few lines of change and I already did that locally for myself. However, for the tables per the current code, it is not easy because EF Core Power Tools is referencing EF Core Scaffolding Generator, and for introducing this part we have to pull a lot of code from EF Core directly as @ErikEJ already said in the previous comments.
|
Fixed in #981 (Finally) - thanks @eminmesic |
For reverse engineering with multiple schemas, an option to sort classes into schema-named directories would be very helpful.
The text was updated successfully, but these errors were encountered: