Open bricelam opened 5 years ago
For example, in the associated class you can apply the RequiredAttribute attribute to a data field. This enforces that a value is provided for the field even if this constraint is not required by the database schema.
Should it apply to model building?
They did in EF6
Any update? Are there any workaround till it got implemented?
@bergi9 This issue is in the Backlog milestone. This means that it is not planned for the next release (EF Core 5.0). We will re-assess the backlog following the this release and consider this item at that time. However, keep in mind that there are many other high priority features with which it will be competing for resources.
The workaround is to configure the model using data annotations on the entity types themselves, or just the model building API in OnModelCreating
.
Annotations on models is not possible for me because my models are t4 generated with partial keyword. So I’m using the model building API till it get implemented.
Note to implementer: The AttributeProvider class in EF6 took care of this (via AssociatedMetadataTypeTypeDescriptionProvider)
Buddy classes are back!