Updating your edmx to reflect changes made in your db (.net linq-to-entities)

前端 未结 11 2141
遥遥无期
遥遥无期 2020-12-04 11:59
  • So I have my edmx made.
  • Then I change my database a little bit, changing a column to from being a NOT NULL to allowing NULL.
  • I go into my edmx, rig
11条回答
  •  时光说笑
    2020-12-04 13:01

    Update/delete from the EDMX is not always functional. If the model doesn't get updated on clicking Update Model from Database let's say when you have updated a view/table in the DB, do the following:

    1) Delete the view/table from the model diagram
    2) Switch the EDMX to xml view (right click the edmx file and select "Open With")
    3) Search and delete the xml entity elements
    4) Switch back to EDMX view
    5) Click Update Model from Database

    This should reflect any kind of change you made to the DB to your EDMX. It's cumbersome, but works flawlessly.

    In an ideal world, i would expect the Update Model from Database to sync the changes from DB to EDMX. But, it doesn't work most of the time.

提交回复
热议问题