Freigeben über


2.1.19 AssociationSet

An AssociationSet contains relationship instances of the specified association. The association specifies the EntityType elements of the two end points, whereas AssociationSet specifies the EntitySet element that corresponds to either these EntityType elements directly or to derived EntityType elements. The association instances that are contained in the AssociationSet relate entity instances that belong to these EntityType elements.

The following is an example of the AssociationSet.

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

The following rules apply to the AssociationSet element:

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

  • AssociationSet MUST have an Association attribute defined. The Association attribute specifies the namespace qualified name or alias qualified name of the Association for which the AssociationSet is being defined.

  • The Association of an AssociationSet MUST be in scope of the Schema that declares the EntityContainer in which this AssociationSet resides.

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

  • An AssociationSet element can contain a maximum of one Documentation element.

  • AssociationSet MUST have exactly two End child elements defined.

  • AssociationSet can contain any number of AnnotationElement child elements.

  • Child elements of AssociationSet are to appear in this sequence: Documentation, End, AnnotationElement.

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

All child elements are to appear in the order indicated.