Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is controller scaffolding missing in MVC 6?

When creating controller in MVC 6 I don't see the scaffolding for creating controller methods? Will they be missing or in the production release?

like image 905
Mostafa Avatar asked May 04 '15 21:05

Mostafa


People also ask

How do you use scaffolding in MVC?

To add a scaffold, right-click on Controllers folder in the Solution Explorer and select Add → New Scaffolded Item. It will display the Add Scaffold dialog. Select MVC 5 Controller with views, using Entity Framework in the middle pane and click 'Add' button, which will display the Add Controller dialog.

How many scaffolding templates are available in MVC?

Answer: There are 6 different types of Scaffold templates in ASP.NET MVC that is used to create a view automatically based on the Model selected.


2 Answers

The namespaces have changed in Core 1.0

"Microsoft.VisualStudio.Web.CodeGenerators.Mvc": "1.0.0-preview1-final",
"Microsoft.VisualStudio.Web.CodeGeneration.Tools": "1.0.0-preview1-final"

info from:

https://wildermuth.com/2016/05/17/Converting-an-ASP-NET-Core-RC1-Project-to-RC2

like image 79
plumdog Avatar answered Sep 19 '22 18:09

plumdog


If you are referring to CRUD scaffolding for controllers and views with ASP.NET 5 and MVC 6, it has been split off from the Visual Studio GUI and moved to command line.

You'll need a package called CodeGenerators, add it to your project.json configuration file as:

"dependencies": {
    ...
    "Microsoft.Framework.CodeGenerators.Mvc": "1.0.0-beta4",
    ...
},

At the moment VS does not offer GUI command to perform scaffolding but you can give a look to this link :

ASP.NET 5 (MVC6) Ground Up #4 - Scaffolding CRUD in MVC

like image 33
Fabio Carello Avatar answered Sep 19 '22 18:09

Fabio Carello