Update controllers / views after changing the database in the MVC4 database

My database administrator decided to rename some fields in the database, so I updated my EF data context.

Now I am wondering if I need to delete / recreate my controllers and views, or can I β€œupdate” them without deleting (since I made changes to my controllers). Any option would be faster than manually editing the changes, as there are quite a few.

Thanks for any advice.

+4
source share
1 answer

Unfortunately, this cannot be ... A model can only update entity classes, not views and controllers.

The trick might be to create a new controller with a new name and keep the old controller. Then copy these important codes from the old controller to the new one.

And the same approach for views

+3
source

Source: https://habr.com/ru/post/1486123/


All Articles