I am going to create a new project called Request Flow for this chapter. To get started, select New Project from the File menu to open the New Project dialog window. Navigate through the Templates section to select the Visual C# > Web > ASP.NET Web Application template and set the name of the project to Request, as shown in Figure 6-1.
Click the OK button to move to the New ASP.NET Project dialog window. Ensure that the Empty option is selected and check the MVC option, as shown in Figure 6-2.
Click the OK button, and Visual Studio will create a new project called RequestFlow.
Adding the Bootstrap Package
Open the console by selecting Package Manager Console from the Tools > Library Package Manager menu and enter the following command:
Visual Studio will download and install the Bootstrap library into the RequestFlow project.
Creating the Controller
Right-click the Controllers folder in the Visual Studio Solution Explorer and select Add > Controller from the pop-up menu. Select MVC 5 Controller – Empty from the list of options and click the Add button. Set the name to be HomeController and click the Add button to create the Controllers/HomeController. cs file. Edit the new file to match Listing 6-1.
Listing 6-1. The Contents of the HomeController.cs File
The controller contains a single action method, called Index. The action method contains no logic and simply returns the result from the View method to have the MVC framework render the default view.
Creating the View
Right-click the Index action method in the code editor and select Add View from the pop-up menu. Ensure that View Name is Index, that Template is set to Empty (without model), and that the boxes are unchecked, as shown in Figure 6-3.
Click the Add button to create the Views/Home/Index. cshtml file. Edit the file to match Listing 6-2. The view simply reports that the content has been rendered from the Index view associated with the Homecontroller. which is all that I will need to demonstrate the techniques for managing request execution.
Listing 6-2. The Contents of the Index.cshtml File
Testing the Example Application
To test the example application, select Start Debugging from the Visual Studio Debug menu. The example application displays a simple message in the browser, as shown in Figure 6-4.