-
Notifications
You must be signed in to change notification settings - Fork 24
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
Dbcontext generated for EFDesigner 2022 now include .UseTpcMappingStrategy() for all tables #98
Comments
I have a similar problem with this. I had an older version of EFDesigner, and my extension updated itself. I'm currently on version 4.2.6.3 of EFDesigner. However, my code base is using EFCore 6.0.27 and .Net 6. But now, when code auto generates, it adds "UseTpcMappingStrategy" to all my tables. And this shows up as "does not contain a definition for UseTcpMappingStrategy". I tried ensuring that my EFModel has the settings for Entity Framework Version = EFCore and Entity Framework Package Version = 6.0.27. I haven't done anything except update the EF Designer extension. Inheritance Strategy = "TablePerHierachy". I'll have to revert back to the older extension to continue using this. Was hoping it was a simple configuration I could do to keep it generating compatible code for .Net 6 & EFCore 6.0.27. I am using EF for SqlServer.
Generated Context in OnModelCreating example below;
Any suggestions would be greater appreciated. Reverting the extension back to 4.2.5.1 fixes this behavior for me. |
Yes I'm getting this exact same issue; but I'm using EfCore 6. Haven't at all touched the model file, just updated the extension to 4.2.7. Doing a bit of digging, the UseTpcMappingStrategy and related extension methods were introduced for EFCore 7 and 8. With my library, I'm getting compile time errors as those extension methods don't exist for EFCore6. Generating these extension methods should be disabled for EFCore6 and earlier. |
I have the same issue so I have to revert to older extension version. If I set TPT as default inheritance strategy in the designer, .UseTpcMappingStrategy().ToTable() is generated for every table and makes mi troubles since I use TPT inheritance. If I delete this .UseTpcMappingStrategy(). everything will wotk, but as soon as I change anything in the designer, code returns which is normal... Please consider this as a bug with priority. |
EF Core 8 latest with postgresql
When I change the model and save changes, dbcontext generated for EFDesigner 2022 now include .UseTpcMappingStrategy() for all tables.
So when I generate the migration for update the database the migration code include:
for each PK of all tables.
Then a new sequence will be created for each pk of each table.
But the sequence of each pk of each table already exists with the name SequenceFieldName
How can I disable this behavior?
The text was updated successfully, but these errors were encountered: