How to: Add and Edit Referential Constraints (Entity Data Model Tools)
This topic describes how to add a referential constraint to a conceptual model with the Entity Data Model Designer (Entity Designer). For more information about referential constraints, see ReferentialConstraint Element (CSDL).
If there is a referential constraint on an association in a conceptual model, the Create Database Wizard propagates the referential constraint to the database. For more information, see Generate Database Wizard (Entity Data Model Tools) and Database Generation Rules (Generate Database Wizard).
Adding or Editing a Referential Constraint in a Conceptual Model
When you use the Entity Designer to add or edit a referential constraint in a conceptual model, the Entity Designer adds or modifies a ReferentialConstraint element in the CSDL content of the .edmx file.
To add or edit a referential constraint in a conceptual model
Double-click the association that you want to edit.
The Referential Constraint dialog box appears.
From the Principal drop-down list, select the principal entity in the referential constraint.
The entity's key properties are added to the Principal Key list in the dialog box.
From the Dependent drop-down list, select the dependent entity in the referential constraint.
For each principal key that has a dependent key, select a corresponding dependent key from the drop-down lists in the Dependent Key column.