How to add data annotation for entities automatically created by Data-First?
问题 If model-first, we use [MetadataType(typeof(ConceptMetadataSource))] to attach a MetadataSource file which contains all the data annotations like [HiddenInput(DisplayValue = false)] or [Display(Name = "Title")] . For example: [MetadataType(typeof(ConceptMetadataSource))] public partial class Concept ... Now, I am using database-first approach since there is an existing database. This time, the entity classes are automatically created by edmx model. At the beginning of each entity class, there