O'Reilly logo

Microsoft Visual Studio 2015 Unleashed, Third Edition by Mike Snell, Lars Powers

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Scaffolding to Generate a Controller and Views

This chapter has presented the details of building a controller and views manually. However, Visual Studio 2015 ASP.NET 5 MVC 6 include a tool for generating a controller class and a set of basic views (create, delete, details, edit, and index) based on your model. This tool is found in the DNX command line (discussed previously) and is called gen. This can save a lot of time generating the basics. You can then adapt these files to your specific needs.

You can use dnx . gen from the Developer Command Prompt for VS2015 console. The following walks you through this process using the Customer and CustomerDbContext model classes created previously:

1. Start by creating a new project based on the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required