So far we have been using plain C# classes as Controllers, but it is far more common have your Controllers inherit from the Controller base class which the MVC framework provides. This allows developers to return complex objects from their Controllers, students in our case. These complex return types are returned in a result that implements the IActionResult interface. We can, therefore, return JSON, XML, and even HTML to return to the client. The usage of this and creating Views is what we will be looking at next in this recipe.
Rendering Views
Getting ready
Open up the StudentController class and modify it to contain attribute-based routing. Be sure to add the using Microsoft.AspNetCore.Mvc; namespace to the StudentController class. Also, inherit from the Controller...