Before updating scaffolding from new db schema dating ideas for asking out
We need to create our own class to override the generation of the fields themselves.To do this we need to extend two classes, namely, Scaffold Sandbox and Scaffold Generator.Scaffold the Product model using “MVC 5 Controller with views, using Entity Framework” scaffolder in Visual Studio 2013.View the generated pages, Index/Edit/Details/Create, to verify things are working properly.Now, suppose we need to modify the Product model to add more fields, like Description and Category.
For purposes of this article, let's create one that uses tables rather than tags to separate fields. Thus, when were done, you'll be able to generate a scaffold with your design by running: The first step is to create a skeleton for our scaffold component.
From now on, you can just focus on building the right model for your application, scaffold, and test it as many times as you need, and don’t have to do anything extra in order to avoid the error mentioned at the beginning of this blog.
This approach will drop and create a new database only when the model is changed, and it won’t leave behind a lot of unused databases, which option 2 will do.
Now you can test view the scaffolded pages and won’t see the error anymore.
The good thing about this approach is you just modify the exact table representing the model that you’re changing, and leave the rest of the database intact.