How to: Create and Edit Association Mappings

[This page is specific to the latest version of the Entity Framework. The latest version is available as the 'Entity Framework' NuGet package. For more information, see Entity Framework Releases and Versioning.]

Associations define relationships between entity types in the conceptual model. Association details are specified in the corresponding association mapping . You can create and edit association mappings in the Mapping Details window of the Entity Designer.

Note

If a referential constraint exists on an association, you cannot map the association. If an entity key-to-entity key referential constraint exists on an association, mappings will be ignored.

For information about how to use the Entity Designer to create associations between entity types, see How to: Create and Modify Associations.

To create an association mapping

  1. Right-click an association in the design surface and select Table Mapping .

    This displays the association mapping in the Mapping Details window.

  2. Click Add a Table or View .

    A drop-down list appears that includes all the tables in the storage model.

  3. Select the table to which the association will map.

    The Mapping Details window displays both ends of the association and the key properties for the entity type at each End.

  4. For each key property, click the Column field, and select the column to which the property will map.

To edit an association mapping

  1. Select an association in the design surface.

    This displays the association mapping in the Mapping Details window.

  2. Click Maps to <Table Name> .

    A drop-down list appears that includes all the tables in the storage model.

  3. Select the table to which the association will map.

    The Mapping Details window displays both ends of the association and the key properties for the entity type at each End.

  4. For each key property, click the Column field, and select the column to which the property will map.

Build Date:

2013-06-19