共用方式為


Role Attribute (Association CSDL)

In the Entity Data Model (EDM), the Role attribute of an <Association> tag specifies the entities related by the association. The association in the following example connects Employee entities based on the manager/employee relationship. Both ends of the association are of the same type, as indicated by the assignment Type="AdventureWorksModel.Employee".

The Role attribute distinguishes between the employee being managed and the manager. 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="AdventureWorksModel.Employee"
                                               Multiplicity="0..1" />
    <End Role="Employee1" Type="AdventureWorksModel.Employee"
                                               Multiplicity="*" />
</Association>

See Also

Concepts

Association Element (SSDL)
Role Attribute (Association SSDL)
AdventureWorks Complete Model (EDM)