CLR Attributes Mapping - Overview
This article is relevant to entity models that utilize the deprecated Visual Studio integration of Telerik Data Access. The current documentation of the Data Access framework is available here.
Telerik Data Access maps a database to a persistent class model by either applying attributes or by using an external XML mapping file. A persistent class is just like any normal object class that you might define as part of your application, except that it is annotated with special information that associates it with a particular database table. These annotations are made as custom attributes on your class declaration. The attributes are only meaningful when you use the class in conjunction with Telerik Data Access. They are similar to the XML serialization attributes in the .NET Framework. These "data" attributes provide Telerik Data Access with enough information to translate queries for your objects into SQL queries against the database and changes to your objects into SQL insert, update and delete commands. In its most elementary form, Telerik Data Access maps a database to a context class, a table to a class, and columns and relationships to properties on those classes. You can also use attributes to map an inheritance hierarchy in your object model. This section outlines the attribute-based approach.
You can also map by using an external XML file. For more information, take a look at the XML Mapping section.
The purpose of this section is to describe the attribute-based mapping in more details. The following sections and topics are included:
- Attributes - describes the different attributes supported by Telerik Data Access.
- Working with the AttributesMetadataSource class - illustrates how to prepare a MetadataContainer from CLR Attributes.