Most of the time a complete list of details is not summarized on an index, list, or search results page like our sortable and pageable table of Vehicles by category on our Home Index page.
A separate Details page is commonly devoted to showing all of the information about an object or entity like a Vehicle.
So in this module we are going to create a Details page to show the complete list of details for a vehicle.
Create the Vehicles controller
Up until now we have only had one controller, the Home controller, whose Index method handles the request to display the landing page for the Fred’s Cars dealership which shows a list of results for Vehicles.
We are going to separate out the rest of the Vehicles functionality into a second controller called of course, VehiclesController.
When we created the Home controller we manually created a class named HomeController and had to write the code to inherit from the base Controller class ourselves. Let’s delve a little into some automated tools. To create the Vehicles controller right click on the controllers folder in the FredsCars project and select Add -> Controller
.

In the Add New Scaffolded Item dialogue, select the selection for MVC Controller - Empty
and click Add.

In the Add New Item dialogue, name the controller VehiclesController.cs and click Add.

Visual Studio then creates a C# class file with a class named VehiclesController that inherits from the base controller class with the following code.
using Microsoft.AspNetCore.Mvc;
namespace FredsCars.Controllers
{
public class VehiclesController : Controller
{
public IActionResult Index()
{
return View();
}
}
}