This issue seems similar to what is reported here, but not sure if it is really the same problem.
We have Inheritance Strategy set to TablePerType and 2 tables inheriting from one base table.
All was working fine with EFDesigner version 4.0.0.6.
Now that we updated our project to EFCore 7, we also updated EFDesigner version to 4.2.1.3.
Without doing any other changes to the model, just regenerating the code, it adds now a .HasNoKey() to the 2 inheriting tables resulting in this run-time error:
System.InvalidOperationException: 'The key {'Id'} cannot be removed from the entity type 'SubTableName' because it is defined on the entity type 'BaseTableName'.'
If I manually remove the 2 .HasNoKey() from the generated code everything is working fine.
This issue seems similar to what is reported here, but not sure if it is really the same problem.
We have
Inheritance Strategy
set toTablePerType
and 2 tables inheriting from one base table. All was working fine with EFDesigner version 4.0.0.6.Now that we updated our project to EFCore 7, we also updated EFDesigner version to 4.2.1.3.
Without doing any other changes to the model, just regenerating the code, it adds now a
.HasNoKey()
to the 2 inheriting tables resulting in this run-time error:System.InvalidOperationException: 'The key {'Id'} cannot be removed from the entity type 'SubTableName' because it is defined on the entity type 'BaseTableName'.'
If I manually remove the 2
.HasNoKey()
from the generated code everything is working fine.