I have a class Movement inheriting from TimeBlock. TimeBlock is provided for me and I can’t change it. TimeBlock provides a DurationDescription property and I want to display it. However I always use LabelFor etc which means I need to have Display metadata on DurationDescription so I can have “Duration Desc.” etc.
How do I add metadata to an inherited class with EF Code First. Am I supposed to use buddy metadata?
Yes, you need to use the MetadataTypeattribute. It will work fine also with inheritance like with partial classes:
On the UI the properties will be displayed as
"My prop 1"and"My prop 2".