Partilhar via


Dependent Element (SSDL)

The Dependent element in store schema definition language (SSDL) is a child element to the ReferentialConstraint element that defines the dependent end of a foreign key constraint (also called a referential constraint). The Dependent element specifies the column (or columns) in a table that reference a primary key column (or columns). PropertyRef elements specify which columns are referenced. The Principal element specifies the primary key columns that are referenced by columns that are specified in the Dependent element.

The Dependent element can have the following child elements (in the order listed):

Applicable Attributes

The following table describes the attributes that can be applied to the Dependent element.

Attribute Name Is Required Value

Role

Yes

The same value as the Role attribute (if used) of the corresponding End element; otherwise, the name of the table that contains the referencing column.

Note

Any number of annotation attributes (custom XML attributes) may be applied to the Dependent element. However, custom attributes may not belong to any XML namespace that is reserved for CSDL. The fully-qualified names for any two custom attributes cannot be the same.

Example

The following example shows an Association element that uses a ReferentialConstraint element to specify the columns that participate in the FK_CustomerOrders foreign key constraint. The Dependent element specifies the CustomerId column of the Order table as the dependent end of the constraint.

<Association Name="FK_CustomerOrders">
  <End Role="Customers" 
       Type="ExampleModel.Store.Customers" Multiplicity="1">
    <OnDelete Action="Cascade" />
  </End>
  <End Role="Orders" 
       Type="ExampleModel.Store.Orders" Multiplicity="*" />
  <ReferentialConstraint>
    <Principal Role="Customers">
      <PropertyRef Name="CustomerId" />
    </Principal>
    <Dependent Role="Orders">
      <PropertyRef Name="CustomerId" />
    </Dependent>
  </ReferentialConstraint>
</Association>

See Also

Concepts

Entity Framework Overview
SSDL Specification

Other Resources

CSDL, SSDL, and MSL Specifications
ADO.NET Entity Data Model Tools