O'Reilly logo

ASP.NET Core Essentials by Shahed Chowdhuri

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

Bringing it all together

To bring it all together, let's make use of Visual Studio's built-in code generation features to take advantage of scaffolding and binding. In this section, we will cover field attributes that assist in model validation.

Before we wrap up this chapter, we will also learn about the use exception handling to catch errors in your code.

Scaffolding, validation, and model binding

Using the PatientRecords project we've built so far, let's add a new controller to it following the following steps, to make use of scaffolding. Instead of clicking on Add Item, we will choose the Controller option:

  1. In Solution Explorer, right-click the Controllers folder.
  2. In the context menu, click Add | Controller.
  3. Select the option to add a new MVC controller ...

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