Export (0) Print
Expand All

CSDL Specification

Conceptual schema definition language (CSDL) is an XML-based language that describes the entities, relationships, and functions that make up a conceptual model of a data-driven application. This conceptual model can be used by the Entity Framework or WCF Data Services. The metadata that is described with CSDL is used by the Entity Framework to map entities and relationships that are defined in a conceptual model to a data source. For more information, see SSDL Specification and MSL Specification.

CSDL is the Entity Framework's implementation of the Entity Data Model.

In an Entity Framework application, conceptual model metadata is loaded from a .csdl file (written in CSDL) into an instance of the System.Data.Metadata.Edm.EdmItemCollection and is accessible by using methods in the System.Data.Metadata.Edm.MetadataWorkspace class. The Entity Framework uses conceptual model metadata to translate queries against the conceptual model to data source-specific commands.

Bb399292.note(en-us,VS.100).gifNote:
The Entity Data Model Designer (Entity Designer) stores conceptual model information in an .edmx file at design time. At build time, the Entity Designer uses information in an .edmx file to create the .csdl file that is needed by the Entity Framework at runtime. For more information, see .edmx File Overview.

The conceptual model metadata can be used to generate the object-layer code for an Entity Framework application. For more information, see Generated Code Overview (Entity Data Model Designer) and How to: Use EdmGen.exe to Generate Object-Layer Code.

The XML schema for the .csdl file can be found in the XML\Schemas folder of your Visual Studio installation directory (for example, C:\Program Files\Microsoft Visual Studio 10.0\Xml\Schemas). The schema for applications that target the .NET Framework version 4 is defined in the System.Data.Resources.CSDLSchema_2.xsd file. The schema for applications that target the .NET Framework version 3.5 SP1 is defined in the System.Data.Resources.CSDLSchema_1.xsd file.

Bb399292.note(en-us,VS.100).gifNote:
Versions of CSDL are differentiated by XML namespaces. The http://schemas.microsoft.com/ado/2008/09/edm namespace is for conceptual models in applications that target the .NET Framework 4. The http://schemas.microsoft.com/ado/2006/04/edm namespace is for conceptual models in applications that target the .NET Framework 3.5 SP1. For information about other CSDL versions and their uses, see ADO.NET Data Services.

In This Section

See Also

Community Additions

ADD
Show:
© 2014 Microsoft