I noticed that DevArt class model code generator does not add either primary key "Key" or Foreign key "ForeignKey" or "Required" Data Annotations.
Shouldn't DevArt code generation template add the data annotation to help entity framework core determine which key is the primary keys and which key is the foreign keys?
Reference
https://msdn.microsoft.com/en-us/librar ... .113).aspx
https://docs.microsoft.com/en-us/ef/core/modeling/keys
Entity Framework Core template and Data Annotations
Re: Entity Framework Core template and Data Annotations
Be aware that the EF Core template generates fluent mapping for all classes (check ModelName.cs).
Anyway, for enabling Data Annotations please open your *.efml model, navigate to Tools > Entity Developer > Model Explorer, select the EF Core template, press F4 (Properties) and set its Validation Framework to Data Annotations. Save the model to regenerate the code (or press F7 in a standalone Entity Developer). Does this help?
Anyway, for enabling Data Annotations please open your *.efml model, navigate to Tools > Entity Developer > Model Explorer, select the EF Core template, press F4 (Properties) and set its Validation Framework to Data Annotations. Save the model to regenerate the code (or press F7 in a standalone Entity Developer). Does this help?
Re: Entity Framework Core template and Data Annotations
Thanks Shalex, enabling Data Annotation solved the problem!Shalex wrote:Be aware that the EF Core template generates fluent mapping for all classes (check ModelName.cs).
Anyway, for enabling Data Annotations please open your *.efml model, navigate to Tools > Entity Developer > Model Explorer, select the EF Core template, press F4 (Properties) and set its Validation Framework to Data Annotations. Save the model to regenerate the code (or press F7 in a standalone Entity Developer). Does this help?