LINQ to SQL supports external mapping, a process by which you use a separate XML file to specify 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 something like a configuration file. For example, you can update how your application behaves after shipping the binaries by just swapping out the external mapping file.
Requirements
The mapping file must be an XML file, and the file must validate against a LINQ to SQL schema definition (.xsd) file.
External mapping overrides attribute-based mapping. In other words, when you use an external mapping source to create a DataContext, the DataContext ignores all mapping attributes you have created on classes. This behavior is true whether the class is included in the external mapping file.
LINQ to SQL does not support the hybrid use of the two mapping approaches (attribute-based and external).
XML Schema Definition File
External mapping in LINQ to SQL must be valid against the following XML schema definition.
Distinguish this schema definition file from the schema definition file that is used to validate a DBML file. For more information, see Code Generation in LINQ to SQL).
Note
Visual Studio users will also find this XSD file in the XML Schemas dialog box as "LinqToSqlMapping.xsd". To use this file correctly for validating an external mapping file, see How to: Validate DBML and External Mapping Files.
Administrators often need access to their data from finance and operations apps, to perform analytics that will help ensure that certain parameters or business metrics are met.