2.1.14 EntityContainer

EntityContainer is conceptually similar to a database or data source. It groups EntitySet, AssociationSet, and FunctionImport child elements that represent a data source.

The following is an example of the EntityContainer element.

   <EntityContainer Name="Model1Container" >
     <EntitySet Name="CustomerSet" EntityType="Model1.Customer" />
     <EntitySet Name="OrderSet" EntityType="Model1.Order" />
     <AssociationSet Name="CustomerOrder" Association="Model1.CustomerOrder">
       <End Role="Customer" EntitySet="CustomerSet" />
       <End Role="Order" EntitySet="OrderSet" />
     </AssociationSet>
   </EntityContainer>

The following rules apply to the EntityContainer element:

  • EntityContainer MUST have a Name attribute defined that is of type SimpleIdentifier.

  • EntityContainer can define an Extends attribute, which, if present, refers to another EntityContainer in scope by name.

  • EntityContainer elements that extend another EntityContainer inherit all of the extended EntitySet, AssociationSet, and FunctionImport child elements from that EntityContainer.

  • EntityContainer can contain a maximum of one Documentation element.

  • EntityContainer can contain any number of AnnotationAttribute attributes. The full names of the AnnotationAttribute attributes cannot collide.

  • EntityContainer can contain any number of FunctionImport, EntitySet, and AssociationSet elements, which can be defined in any order.

  • FunctionImport, EntitySet, and AssociationSet names within an EntityContainer cannot collide.

  • If present, the Documentation child element MUST precede FunctionImport, EntitySet, and AssociationSet child elements.

  • In CSDL 2.0 and CSDL 3.0, EntityContainer can contain any number of AnnotationElement elements.

  • In CSDL 3.0, EntityContainer can contain any number of ValueAnnotation elements.

  • In the sequence of child elements under EntityContainer, AnnotationElement follows all other elements.

Graphic representation in table format of the rules that apply to the EntityContainer element.

All child elements are to appear in the order indicated. For all child elements within a given choice, the child elements can be ordered arbitrarily.