Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Dependent Element (CSDL)

The Dependent element in conceptual schema definition language (CSDL) is a child element to the ReferentialConstraint element and defines the dependent end of a referential constraint. A ReferentialConstraint element defines functionality that is similar to a referential integrity constraint in a relational database. In the same way that a column (or columns) from a database table can reference the primary key of another table, a property (or properties) of an entity type can reference the entity key of another entity type. The entity type that is referenced is called the principal end of the constraint. The entity type that references the principal end is called the dependent end of the constraint. PropertyRef elements are used to specify which keys reference the principal end.

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

Applicable Attributes

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

Attribute Name Is Required Value

Role

Yes

The name of the entity type on the dependent end of the association.

Ee473432.note(en-us,VS.100).gifNote:
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 a ReferentialConstraint element being used as part of the definition of the PublishedBy association. The PublisherId property of the Book entity type makes up the dependent end of the referential constraint.

<Association Name="PublishedBy">
  <End Type="BooksModel.Book" Role="Book" Multiplicity="*" >
  </End>
  <End Type="BooksModel.Publisher" Role="Publisher" Multiplicity="1" />
  <ReferentialConstraint>
    <Principal Role="Publisher">
      <PropertyRef Name="Id" />
    </Principal>
    <Dependent Role="Book">
      <PropertyRef Name="PublisherId" />
    </Dependent>
  </ReferentialConstraint>
</Association>

See Also

Community Additions

ADD
Show:
© 2015 Microsoft