OnDelete Element (Association SSDL)

In the Entity Data Model (EDM), the OnDelete child element of an End element represents a foreign key constraint in the data source that has been defined with ON DELETE CASCADE. The same OnDelete action is usually specified in both the conceptual model and storage model, but this alignment is not required. The association in the following example defines a referentially constrained relationship between a SalesOrderHeader entity and one or more SalesOrderDetail entities. When a SalesOrderHeader entity is deleted, all related SalesOrderDetail entities are also deleted.

  <Association Name="FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID">
    <End Role="SalesOrderHeader" Type="AdvWrksSalesModel.Store.SalesOrderHeader" Multiplicity="1">
      <OnDelete Action="Cascade" />
    </End>
    <End Role="SalesOrderDetail" Type="AdvWrksSalesModel.Store.SalesOrderDetail" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="SalesOrderHeader">
        <PropertyRef Name="SalesOrderID" />
      </Principal>
      <Dependent Role="SalesOrderDetail">
        <PropertyRef Name="SalesOrderID" />
      </Dependent>
    </ReferentialConstraint>
  </Association>

See Also

Concepts

End Element (Association SSDL)
OnDelete Element (Association CSDL)