Page 1 of 1

Extend properties on Entity/Association/Property

Posted: Thu 12 Oct 2017 18:10
by Jurjen
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.

Re: Extend properties on Entity/Association/Property

Posted: Fri 13 Oct 2017 16:17
by Shalex
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

Re: Extend properties on Entity/Association/Property

Posted: Sat 14 Oct 2017 19:42
by Jurjen
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 ?

Re: Extend properties on Entity/Association/Property

Posted: Tue 17 Oct 2017 11:47
by Shalex
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

Re: Extend properties on Entity/Association/Property

Posted: Sat 21 Oct 2017 10:43
by Jurjen
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.

Re: Extend properties on Entity/Association/Property

Posted: Mon 23 Oct 2017 17:38
by Shalex
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.

Re: Extend properties on Entity/Association/Property

Posted: Tue 21 Nov 2017 20:43
by Jurjen
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.

Re: Extend properties on Entity/Association/Property

Posted: Thu 23 Nov 2017 09:56
by Shalex
We have just sent the extended trial to the email specified in your forum profile.

Re: Extend properties on Entity/Association/Property

Posted: Thu 23 Nov 2017 10:47
by Jurjen
Got it!
Thank you!