Closed mtanneryd closed 1 year ago
The problem seems to be that I need to somehow NOT generate "builder.HasKey" in the Configure method of the derived class.
Adding this in method PrimaryKeyModelBuilder in class GeneratorEfCore seems to do the trick.
if (t.PrimaryKeys.All(k=>k.Hidden)) return "";
Thanks Måns, this will be in the next release.
Released in v3.8.1
Hi!
I'm running into some problems with TPT when generating using TemplateType.EfCore7. Is it supposed to work? I get the following result when launching the app:
InvalidOperationException: A key cannot be configured on 'ComputedCurveCategorySource' because it is a derived type. The key must be configured on the root type 'CurveCategorySource'. If you did not intend for 'CurveCategorySource' to be included in the model, ensure that it is not referenced by a DbSet property on your context, referenced in a configuration call to ModelBuilder, or referenced from a navigation on a type that is included in the model.
I'll try to create a small sample and post it later.