Megosztás a következőn keresztül:


Update Model Wizard (Entity Data Model Tools)

The ADO.NET Update Model Wizard is used to update an .edmx file after changes have been made to the underlying database. (For more inormation about .edmx files, see .edmx File Overview (Entity Framework).)

The Update Model Wizard starts after you right-click the .edmx file in the Model Browser window and select Update Model from Database. The Update Model Wizard displays three tabs in the Choose Your Database Objects dialog box:

Tab Description

Add

Enables you to choose which new database objects you want to add to the .edmx file.

Refresh

Displays a tree view of all database objects whose definitions will be refreshed in the storage model.

Delete

Displays a tree view of all database objects that will be deleted from the storage model.

The Update Model Wizard does the following:

  • If an object has been deleted from the database, the wizard removes the object from the storage model. Mapping specifications are updated so that objects in the conceptual model are not mapped to storage elements that no longer exist. Existing conceptual model objects are not deleted.

  • If an object has been added to the database (or was not included in the previous model), you can choose to add the object to the model. The storage model is updated with the newly-added object. In the case of a table or view (but not a stored procedure), a corresponding entity type is created and mapped to the object.

  • If an object has been updated, the wizard updates the object definition in the storage model. If any new columns have been added to a table or view, the corresponding entity types are updated with matching properties. If the corresponding entity types are part of an inheritance hierarchy, only the affected entity closest to the root of the hierarchy is updated with matching properties. This prevents child entities in the hierarchy from defining the same properties as their ancestors.

NoteNote

If you delete an object from the conceptual model and then want to use the Update Model Wizard to add the object back to the model, you must first delete the object from the storage model. For more information see How to: Delete Objects from the Storage Model (Entity Data Model Tools).

Beginning with Visual Studio 2010, the Choose Your Database Objects dialog box also allows you to perform the following customizations:

  • Apply English-language rules for singulars and plurals to entity, entity set, and navigation property names when the .edmx file is generated.

  • Include foreign key columns as properties on entity types.

For more information, see Choose Your Database Objects Dialog Box (Entity Data Model Wizard).

In This Section

See Also

Tasks

How to: Update an .edmx File when the Database Changes (Entity Data Model Tools)

Concepts

ADO.NET Entity Data Model Designer

Other Resources

Entity Data Model Wizard