Data Access has been discontinued. Please refer to this page for more information.

XML Mapping

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 domain 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.

How to Change the Mapping Type

The mapping type could be specified during the domain model generation, in the Advanced Options Dialog. Once your model is generated, you are still able to change the mapping type. In order to do so, you need to go to the Code Generation Settings tab page in the Model Settings Dialog.

The generated classes and properties will not be decorated with attributes.

All mapping information will be taken from the Rlinq file.

XML File Format

When you use the xml-based approach, the mapping information is preserved in the form of an Xml file. Practically, that file is the RLINQ file itself. For more information about the XML File format, please read here.

Generating MetadataContainer from XML

The XmlMetadataSource class allows you to create (load) a MetadataContainer from a XML based source. The XmlMetadataSource class, exposes five static factory methods allowing you to create a new XmlMetadataSource instance from different objects. When you have an instance of the XmlMetadataSource class, you have to invoke the GetModel method to access the loaded metadata container. Fore more information, read here.