Freigeben über


Multiplicity Attribute (Association CSDL)

In the Entity Data Model (EDM), the Multiplicity attribute of the End element of an association specifies the number of entities of each type that can be related by an association.

The association in the following example connects Employee entities based on the employee/manager relationship. Both ends of the association are of the same type as indicated by the assignment Type="AdventureWorksModel.Employee".

The Multiplicity attribute specifies that an Employee who is a manager can participate in zero or more instances of this association but an Employee1 can have only one manager and can participate in only one association of this type. This multiplicity designation corresponds to the relationship contained by the foreign key in the Employee table that can contain only one ManagerID.

<Association Name="Employee_Employee_ManagerID">
    <End Role="Employee" Type="Self.Employee" Multiplicity="0..1" />
    <End Role="Employee1" Type="Self.Employee" Multiplicity="*" />
  </Association>

This example illustrates the one-to-many multiplicity of an association. For a complete example that use a many-to-many association, see Annotation and Research Collaboration Tool (EDM Sample Application)

See Also

Concepts

AssociationSet Element (EntityContainer CSDL)
Multiplicity Attribute (Association SSDL)
AssociationSetMapping Element (MSL)
Type Attribute (Association CSDL)
AdventureWorks Complete Model (EDM)
Role Attribute (Association CSDL)