Extend properties on Entity/Association/Property

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
Jurjen
Posts: 5
Joined: Thu 12 Oct 2017 17:44

Extend properties on Entity/Association/Property

Post by Jurjen » Thu 12 Oct 2017 18:10

Good evening,

Is it possible to add properties to an Entity (LinqClass) / Association (MsLinqAssociation) / Property (LinqProperty) ?

I'm just evaluating EntityDeveloper to see if we could use it to replace our current CodeGenerator. It looks promising, we would be using our own T4-templates but need extra information from the above mentioned types, is it possible to extend them and if that's possbile how would I go about doing that?

kind regards,

Jurjen de Groot
Netherlands.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Extend properties on Entity/Association/Property

Post by Shalex » Fri 13 Oct 2017 16:17

Jurjen wrote:Is it possible to add properties to an Entity (LinqClass) / Association (MsLinqAssociation) / Property (LinqProperty) ?
You can extend an existing object model with Extended Properties: http://www.devart.com/entitydeveloper/e ... eloper.chm (do Properties > Unblock if content is not displayed) > Template System Concepts > Declaring Extended Properties in Templates.

Refer to the existing templates for examples how to define and use extended properties.
Jurjen wrote:we would be using our own T4-templates but need extra information from the above mentioned types, is it possible to extend them and if that's possbile how would I go about doing that?
Be aware that Entity Developer code generator system is based on its own object model. You can create your own (or modify existing) templates for using them in Entity Developer. Its engine uses T4-like template language: https://www.devart.com/entitydeveloper/ ... ation.html.

Our documentation doesn't include reference for classes used in the templates, but there are some tips:
* use IntelliSense feature in our T4 Editor (completion list appears when you type the '.' character)
* you can switch to the model in design time to read a description of a particular property in the Properties window
* general T4 reference: http://msdn.microsoft.com/en-us/library/bb126478.aspx
* decompiling C:\Program Files (x86)\Common Files\Devart\EntityDeveloper\EntityDeveloper.Common.dll and C:\Program Files (x86)\Common Files\Devart\EntityDeveloper\EntityDeveloper.Orm.Common.dll may help you to get acquainted with the needed classes and their functionality

Jurjen
Posts: 5
Joined: Thu 12 Oct 2017 17:44

Re: Extend properties on Entity/Association/Property

Post by Jurjen » Sat 14 Oct 2017 19:42

That was pretty easy to do, those extended properties :-)

Is 't possible to create extended properties using other types than just System.Int32, System.string, .... ?

I would like to add a property to set the DatabaseType of the entity-property so field Id is D_ID, or field Status is D_ENUM etc. (As used in Firebird DB) ... so I'd like to be able to select the domain from a list within the property-grid, currently I'd have to type this manually for each property.

Is something like that possible ?

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Extend properties on Entity/Association/Property

Post by Shalex » Tue 17 Oct 2017 11:47

Jurjen wrote:Is 't possible to create extended properties using other types than just System.Int32, System.string, .... ?
Yes, it is.

For this, you should:

1) place an assembly with the required type either to GAC or to C:\Program Files (x86)\Devart\EntityDeveloper\

2) specify Type.AssemblyQualifiedName, e.g.:
System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

Jurjen
Posts: 5
Joined: Thu 12 Oct 2017 17:44

Re: Extend properties on Entity/Association/Property

Post by Jurjen » Sat 21 Oct 2017 10:43

Shalex,

1. I've created an assembly with a type and put the dll in the specified folder.

Step 2 isn't clear to me. I've tried adding the assembly in the ModelSettings Windows under Attributes but I'm not clear as to where I should add the type with FullyQualified name. I've tried the refresh button but that doesn't seem to do anything. Should I create my custom 'types' in another fashion in my assembly ?

Could you clarify that for me ?

thanks,
Jurjen.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Extend properties on Entity/Association/Property

Post by Shalex » Mon 23 Oct 2017 17:38

Please navigate to Model Settings > Model > Extended Properties, select the type of extended property and press Add. Now specify Type.AssemblyQualifiedName in the Property Type field.

Jurjen
Posts: 5
Joined: Thu 12 Oct 2017 17:44

Re: Extend properties on Entity/Association/Property

Post by Jurjen » Tue 21 Nov 2017 20:43

Hi Shalex,

I've been very busy the last few weeks, today I had some time but at this time the trial has expired, is there any way to extend the trial with a week or two?

Jurjen.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Extend properties on Entity/Association/Property

Post by Shalex » Thu 23 Nov 2017 09:56

We have just sent the extended trial to the email specified in your forum profile.

Jurjen
Posts: 5
Joined: Thu 12 Oct 2017 17:44

Re: Extend properties on Entity/Association/Property

Post by Jurjen » Thu 23 Nov 2017 10:47

Got it!
Thank you!

Post Reply