EntityContainerMapping Element (MSL)

In the Entity Data Model (EDM), the EntityContainerMapping element maps the entity container declared and defined in the conceptual schema to the entity container in the storage metadata schema.

In the conceptual schema, an entity container is the specification for a class in the programming object model. In the storage metadata schema, an entity container is the designation for database structures used by applications built on this data model: the tables and columns.

<?xml version="1.0" encoding="utf-8"?>
<Mapping Space="C-S" 
    xmlns="urn:schemas-microsoft-com:windows:storage:mapping:CS">

<EntityContainerMapping CdmEntityContainer="HumanResources"
                      StorageEntityContainer="HumanResources">

In the XML hierarchy, the EntityContainer element is separate from the Schema element even though the EntityContainer is defined in the schema. This is important in mapping the EntityContainer to storage because the EntityContainer elements in the conceptual schema are mapped to corresponding EntityContainer elements in the storage metadata. In the mapping file, the name of the EntityContainer does not include the schema namespace name. The use of an entity container name qualified by the schema namespace name causes a mapping exception.

The CdmEntityContainer element identifies an EntityContainer that contains entity sets and association sets defined in conceptual schema definition language (CSDL). The StorageEntityContainer identifies the container for elements of the storage model as specified in store schema definition language (SSDL). The mapping specification connects the containers defined in the schemas.

For more information about entity containers, see Entity Containers (EDM).

See Also

Show: