Create MetadataType classes

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
Posts: 1
Joined: Tue 10 Jul 2012 18:11

Create MetadataType classes

Post by mitchellj » Tue 10 Jul 2012 18:20

Currently I am using MVC with a E.F model generated by DevArt using Entity Developer, one of the things I cannot see how to do easily is add DisplayName() attributes to classes.

I know in MVC you can provide a [MetadataType] to point to a different "holder class" which holds meta data details. I was just wondering if theres a "simple" way to do this in DevArt or if it's

1) Autocreate all partial classes then manually populate these classes by hand with the MetadataType tag and elemnts.

2) Edit the template and get it to do the heavy lifting.

Any help would be much appreciated.

Site Admin
Posts: 8248
Joined: Thu 14 Aug 2008 12:44

Re: Create MetadataType classes

Post by Shalex » Thu 12 Jul 2012 16:24

mitchellj wrote:one of the things I cannot see how to do easily is add DisplayName() attributes to classes
You can do that in the following way:
1) right click on the diagram surface > Model Settings > Model | Attributes > Add | select the System.dll assembly from GAC and press OK. Then "Clear All" attributes and select only System.ComponentModel.DisplayNameAttribute and press OK. Now this attribute is available for all classes in your model.
2) select your class on the diagram or in Model Explorer and pres "..." against the Attributes property in the Properties window (F4). Add DisplayNameAttribute(String) to your class and set its "display Name".

Post Reply