Using Element (CSDL)

The Using element in conceptual schema definition language (CSDL) imports the contents of a conceptual model that exists in a different namespace. By setting the value of the Namespace attribute, you can refer to entity types, complex types, and association types that are defined in another conceptual model. More than one Using element can be a child of a Schema element.


The Using element in CSDL does not function exactly like a using statement in a programming language. By importing a namespace with a using statement in a programming language, you do not affect objects in the original namespace. In CSDL, an imported namespace can contain an entity type that is derived from an entity type in the original namespace. This can affect entity sets declared in the original namespace. For more information about entity sets, see EntitySet Element.

The Using element can have the following child elements:

Applicable Attributes

The table below describes the attributes can be applied to the Using element.

Attribute Name Is Required Value



The name of the imported namespace.



An identifier used in place of the namespace name. Although this attribute is required, it is not required that it be used in place of the namespace name to qualify object names.


Any number of annotation attributes (custom XML attributes) may be applied to the Using element. However, custom attributes may not belong to any XML namespace that is reserved for CSDL. The fully-qualified names for any two custom attributes cannot be the same.


The following example demonstrates the Using element being used to import a namespace that is defined elsewhere. Note that the namespace for the Schema element shown is BooksModel. The Address property on the Publisher EntityType is a complex type that is defined in the ExtendedBooksModel namespace (imported with the Using element).

  <Schema xmlns=""
          Namespace="BooksModel" Alias="Self">

    <Using Namespace="BooksModel.Extended" Alias="BMExt" />
<EntityContainer Name="BooksContainer" >
      <EntitySet Name="Publishers" EntityType="BooksModel.Publisher" />
<EntityType Name="Publisher">
        <PropertyRef Name="Id" />
      <Property Type="Int32" Name="Id" Nullable="false" />
      <Property Type="String" Name="Name" Nullable="false" />
      <Property Type="BMExt.Address" Name="Address" Nullable="false" />

See Also


Entity Framework Overview
CSDL Specification
Schema Element (CSDL)

Other Resources

CSDL, SSDL, and MSL Specifications
ADO.NET Entity Data Model Tools
Entity Data Model: Namespaces