Entity Framework : How do you refresh the model when the db changes?

前端 未结 9 952
囚心锁ツ
囚心锁ツ 2020-12-01 01:56

If you build the edmx file from the database and then the db changes, how do you get the model to pick up the change?

Do you delete the whole model and regenerate or

9条回答
  •  执念已碎
    2020-12-01 02:15

    Are you looking at the designer or code view? You can force the designer to open by right clicking on your EDMX file and selecting Open With -> ADO.NET Entity Data Model Designer

    Right click on the designer surface of the EDMX designer and click Update Model From Database...

    All entities are refreshed by default, new entities are only added if you select them.


    EDIT: If it is not refreshing well.

    • Select all the tables and view-s in the EDMX designer.
    • Delete them.
    • Then, update model from database

提交回复
热议问题