reference/documentation for template language API

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
mindplay
Posts: 148
Joined: Tue 13 Dec 2011 22:58
Location: Ithaca, NY

reference/documentation for template language API

Post by mindplay » Fri 16 Dec 2011 14:19

Where is the reference/documentation for the template language API?

It's great that templates are editable - I've already made a number of customizations. But without documentation it's all guesswork, trial and error.

In particular, I need documentation for EntityDeveloper.ContextModel and the EntityDeveloper.NHibernate namespace...

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

Post by Shalex » Tue 20 Dec 2011 11:22

T4 documentation:
- download http://www.devart.com/entitydeveloper/e ... eloper.chm and open the Common Concepts > Working with Templates section;
- general T4 reference, e.g. http://msdn.microsoft.com/en-us/library/bb126478.aspx .

There is no description of the EntityDeveloper.ContextModel and the EntityDeveloper.NHibernate namespaces in our documentation. But there is an IntelliSense feature in our T4 Editor. Also you can switch to the model in design time to read a description of a particular property in the Properties window.

mindplay
Posts: 148
Joined: Tue 13 Dec 2011 22:58
Location: Ithaca, NY

Post by mindplay » Tue 20 Dec 2011 14:51

Design-time descriptions only seem to be available for some types/properties? For example, nothing happens when I hover over a local variables typed as HibernateClass...

mindplay
Posts: 148
Joined: Tue 13 Dec 2011 22:58
Location: Ithaca, NY

Post by mindplay » Tue 20 Dec 2011 17:08

On a related note, where is the "Validation.tmpl" file located?

In the standard template:
I'd like to customize this file - you did mention adding synchronization for the Validate Max Length property when using Model First, but that's not quite good enough for me; I don't want the duplication, I want the string length validation automatically added, by default...

mindplay
Posts: 148
Joined: Tue 13 Dec 2011 22:58
Location: Ithaca, NY

Post by mindplay » Tue 20 Dec 2011 21:16

It's taking me hours to do even simple things here - I had to use reflection and throw exceptions with descriptions of properties and types to figure out the property structures... Please consider publishing the documentation for the API!

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

Post by Shalex » Fri 23 Dec 2011 10:58

mindplay wrote:Design-time descriptions only seem to be available for some types/properties? For example, nothing happens when I hover over a local variables typed as HibernateClass...
We plan to implement this functionality but no timeframe.
mindplay wrote:On a related note, where is the "Validation.tmpl" file located?
We will include the following information in our Entity Developer documentation:

Editing and Saving Validation Templates
By default, when the entity property validation mechanism is enabled, the validation template is included into the template.

If you need to edit the validation template, perform the following sequence of actions:

In the Template node of the Model Explorer area, right-click the template selected in Step 1 of the previous procedure and, from the drop-down menu, select Open.
In the code of the template, locate the following line: "include file="Validation.tmpl"".
Place the cursor on Validation.tmpl and press F12.
Copy the text of the validation template into a new file.
Make required change and save the file with the Validation.tmpl name into a location as described in the table below:

Usage Specifics: The validation template is used for a particular model generation template, which is not the same as the predefined template.
Where To Save: The validation template must be saved in the same folder as the model generation template.

Usage Specifics: The modified validation template is used for a particular model.
Where To Save: The validation template must be saved in the same folder as the model file. The name of the validation template file must be Validation.tmpl or MODELNAME.Validation.tmpl.

Usage Specifics: The modified validation template is used in all models, for all ORMs, etc.
Where To Save: The validation template must be saved in the Shared Templates folder.

mindplay wrote:you did mention adding synchronization for the Validate Max Length property when using Model First, but that's not quite good enough for me; I don't want the duplication, I want the string length validation automatically added, by default...
We have changed the behaviour: the Validate Max Length Length attribute will be initialized after setting Length starting from the next build of Entity Developer. As a result, string length validation automatically will be added. We will post here when the corresponding build is available for download.

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

Post by Shalex » Thu 12 Jan 2012 16:38

New build of Entity Developer 4.2.110 is available for download now!
It can be downloaded from http://www.devart.com/entitydeveloper/download.html (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to http://www.devart.com/forums/viewtopic.php?t=23135 .

Post Reply