Up Entity Customization

Metadata class

Last modified on August 15, 2012 17:20

The entity metadata class provides total control over the attributes that adorn the generated entity class properties.

Many UI technologies, WPF and Silverlight controls in particular, inspect the data-bound entity properties, looking for UI hint attributes such as Bindable, and adjusts the presentation accordingly. The vocabulary of UI hint attributes is rich and growing.

Validation engines on both client and server also inspect entities for validation attributes such as Required; the engines turn these attributes into rules that they apply when validating entities.

The DevForce EDM Designer Extension gives you some say over the attributes that the DevForce code generator applies to your properties. But it may not produce all of the attributes you need in the way that you need them.

Fortunately, you can write a metadata class (aka, the "buddy" class) to specify precisely the attributes that should be applied to a designated property.

The DevForce code generator looks for a "buddy" class. It compares field and property names in that class with the names of the properties it is generating. Where the names match, it uses the attributes in the buddy class instead of the attributes it would have applied.

Tags: Architecture
Created by DevForce on March 13, 2011 20:46

This wiki is licensed under a Creative Commons 2.0 license. XWiki Enterprise 3.2 - Documentation. Copyright © 2020 IdeaBlade