Xml 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 either as custom attributes on your class declaration or as external XML file.
An external mapping is a process by which you use a separate XML file to specify a mapping between the data model of the database and your object model. Advantages of using an external mapping file include the following:
- You can keep your mapping code out of your application code. This approach reduces clutter in your application code.
- You can treat an external mapping file like something similar to a configuration file. For example, you can update how your application behaves after shipping the binaries by just swapping out the external mapping file.
- Mapping files enable additional scenarios where separating mapping from code is desirable.
This section outlines the external XML file approach.
You can also map by using CLR attributes. For more information, take a look at the CLR Attributes Mapping section.