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

前端 未结 11 2121
遥遥无期
遥遥无期 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:00

    What I have successfully done is this (VB.Net).

    1. make updates to the database as desired/ required
    2. Choose "Update from database" in the EDMX model, the graphical model will correctly show the new structure/tables
    3. Expand the project so that it shows all related files
    4. The two files with the "tt" extension are the ones that matter: first take the one WITHOUT the .Context. before the tt extension. right click on it and choose Run Custom Tool:

    1. Do the same for the .tt file with the .Context. in its name. All of your code and logical model classes will be updated.

提交回复
热议问题