How to access Extended Properties in templates

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
Posts: 29
Joined: Mon 27 Jan 2014 21:08

How to access Extended Properties in templates

Post by billster6809 » Tue 08 Apr 2014 23:27

I have created a number of Class, Property and RelationProperty extended properties in my model. I used the "Model Settings" dialog to create them. I then used them throughout my model. I see that they are added in the .edps file.

Now I want to access them within the template to alter the code generation. I can't figure out how to access them.

Here is an example: I added a Class extended property called "UDF", of type boolean. I set it on entities which are intended to implement a particular interface, "IUserDefinedFields".

Next, in the template, (based on DbContext), I found the section which adds the base classes and interfaces, under a section if (cls.BaseInheritance == null).

In there, where in the cls EntityClass instance do I get at that UDF property?

The only example I find in the help file is for RelationProperties, defined within the template and not using the Model Settings.

I assume I will need a hint for how to access the Property and maybe RelationProperty entries as well.

Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: How to access Extended Properties in templates

Post by MariiaI » Fri 11 Apr 2014 05:18

You can access the extended properties in the template via the GetProperty method:

Code: Select all

If you have any further questions, feel free to contact us.

Post Reply