For the basic functionality of my project I've been defining Entity Framework models and then using the scaffolding feature of Visual Studio to implement CRUD functionality (Right Click
-> Add
-> New Scaffolded Item...
).
If I need to make a change to the model after I've done this, how do I make the scaffolded controllers and views update to the latest model changes? For example, I'm seeing the need now to add a new attribute to my model and change the data type of an existing one, but the controllers and views likely won't work after the change.
I could always just re-scaffold, but I've made some changes to the controller and views already which I don't want to lose. Is my only solution to make the changes myself?
Rename the files having your changes, scaffold again, and replace the newly-scaffolded files with your originals.
Naturally, you'll have to reconcile any domain changes that were made to the files containing your changes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With