Page 1 of 1

How to set "preferred validation framework"?

Posted: Thu 05 Jan 2012 17:20
by johnwest80
The release notes for the latest version mention that

"You just need to select the preferred validation framework and set validation parameters, such as max value, min value, max length, min length, regular expression, or to select one of the predefined property formats. After this Entity Developer will generate validation attributes for entity properties in the generated code".

This must be obvious, but I can't find where to select it. Or else I'm doing something else wrong. I'm setting min/max lengths on the EntityProperties, but they're not being honored in my gui. However, if I manually go set the DataAnnotation attributed in ED, that works.

Also, on another note, being able to specify a friendly name and description for each EntityProperty would be very helpful, too. I'm currently doing this in DataAnnotations.

John

Posted: Thu 05 Jan 2012 17:31
by SecureGen
To enable the entity property validation mechanism, perform the following sequence of actions:

In the Template node of the Model Explorer area, select the required template.
In the Validation section of the Properties area for the selected template, locate the Validation Framework row and select the appropriate framework.

Posted: Thu 05 Jan 2012 17:42
by johnwest80
Perfect! Just needed to be pointed in the right direction.

Any thoughts about adding some additional data annotation attributes to the entity properties themselves? I'm sure these fields, like name and description, could be used by nhibernate and other frameworks as well for generating error messages. Thoughts?

Posted: Thu 05 Jan 2012 17:46
by SecureGen
You can read about how to work with the validation feature of Entity Developer in the Entity Property Validation topic of Devart Entity Developer Documentation. This topic is located in the Common Concepts section.