Creating Scaffolding template for Cutom Model

Creating Custom Scaffolding

What is Scaffolding in MVC

Scaffolding is a Templates for Create, Delete, Edit ,Details. It will reduce the time for developer for creating controller,view for the specific model
This is a Scaffolding package for ASP.NET which is installed via NuGet using ‘Install-Package MvcScaffolding’ command

Using Templates

Step : 1

Create Sample web project

Step : 2

Create custom model as like below

scaff1

Step : 3

Here we going to install the scaffolding in our project.
GoTo Tools –> Library Package Manager –> Package Manager Console as shown below to install the scaffolding

scaff2

To install Scaffolding, type below command in below console
cmd : Install-Package MvcScaffolding

scaff3

Step : 4

Next creating template against custom model by using below command

cmd : Scaffold controller EmployeeModel

Scaff6
After executing the command in console, it will create the template for CRUD Operation as shown below

scaff5

 

Output :

After generation of Views, run the application. Now u can perform CURD Operation without extra code.

scaff7