共用方式為


Name (關聯 SSDL)

在 實體資料模型 (EDM) 中,存放結構定義語言 (SSDL) 內的 Association 定義包含一個 Name 屬性,這個屬性會識別所設計的物件模型及對應規格中的型別。

下列來自 Adventure Works 模型中 Human Resources 資料分割的宣告顯示 Employee實體宣告。 指派 Name 屬性:Name="FK_Employee_Employee_ManagerID"。 這個關聯在 Employee 實體之間。 其中一個 Employee 實體會指定為經理。 這裡所用的命名規範指示此關聯是根據資料庫 Employee 資料表中的 ManagerID 外部索引鍵。

  <Association Name="FK_Employee_Employee_ManagerID">
    <End Role="Employee" Type="Adventureworks.Store.Employee" Multiplicity="0..1" />
    <End Role="Employee1" Type="Adventureworks.Store.Employee" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Employee">
        <PropertyRef Name="EmployeeID" />
      </Principal>
      <Dependent Role="Employee1">
        <PropertyRef Name="ManagerID" />
      </Dependent>
    </ReferentialConstraint>
  </Association>

另請參閱

概念

Association 項目 (SSDL)
AdventureWorks 完整模型 (EDM)
ReferentialConstraint 項目 (關聯 SSDL)