简体   繁体   中英

Update module from Database in entity framework without using third party tools

In Entity Framework, I always use the Update module from Database option, but It's not covering all kind of updates, sometimes it's more easier to delete the EF and add it back than fixing and verifying whether this option reflected the updates or not,

In my current project i have added a Self-Join relation and then i used the Update module from Database option, but it didn't update it correctly,

I can find that table and the new relation in the Module diagram but in the code behind it's not reflecting the update correctly, This time i have my custom changes on the EF? It is not possible to delete and add again this time, My question is:

Is there any reliable and easy way to update the EF from DB without using third party tools?

After clicking the Update module from Database , Two clicks are needed, orderly:

  1. Right Click on the .tt file and choose Run Custom Tool . Wait Until is Finished.
  2. Right Click on the .Context.tt file and choose Run Custom Tool . Wait Until is Finished.

I used this method in Visual Studio 2012 for many scenarios and it's updating fine with no errors.

Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM