-
-
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
Adds support for Using EntityTypeConfiguration files. #2582
Adds support for Using EntityTypeConfiguration files. #2582
Conversation
…TypeConfiguraiton usage. adds warning if you try to use use-t4 and use-t4-split. Adds warning if you try to use use-t4 and split-dbcontext-preview.
@ErikEJ The only thing I don't have is the unzipping of the file. I looked and it seems like the code that drops the templates is only called via the GUI. Unless I'm missing something. |
There is a T4Helper class (I also missed that when updating to EF Core 9) |
Adds T800 Zip File unzipping for CLI.
Ok, I think it's ready now. I did not add .Net 9 versions of the split entities largely because I don't have any of the net9 stuff setup atm. |
This is great, just added a few comments |
Adds use-t4-split to the VS schema json. Moves the warnings about use-t4-split + use-t4 to ReverseEngineerRunner Fxes UseT4Split JsonPropertyOrder being the same as UseT4 Removes sample EntityTypeConfiguration now that it exists in the 800_split folder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this is a great addition
I plan to release a new non-nightly version sometime next week after .NET 9 RTW |
Handles most of #2583. (won't be handling the GUI side of things)
TODO:
use-t4-split
to CLIuse-t4
anduse-t4-split
. In the case of using both, respect use-t4 instead.rootNameSpace
value ifuse-t4-split
is used.Couple items on this approach:
I grabbed the EntityTypeConfiguration from https://github.com/R4ND3LL/EntityFrameworkRuler/blob/main/src/EntityFrameworkRuler.Design/Resources/EntityTypeConfiguration.t4 (which was linked in T4 customizations and tips #1499. It's for .Net7, but for whatever reason, MS didn't include it in their ef templates for .net 8 :(.
You need to have context-splitting-preview turned off.
One note is that to make this work you need to have a modified version of DbContext.t4 that replaces the ModelLines with calling the ApplyConfiguration instead. Not sure how we want to represent this if someone wants to use this.This is now covered by having the version of the DbContext.t4 in the T4_800_Split.zip file.So before:(leaving the info below just for future reference as to what is different)After: