Chapter 4: The MVC Pattern using Razor
The Model View Controller (MVC) pattern is probably one of the most extensively adapted architectural patterns for displaying web user interfaces. Why? Because it matches the concept behind HTTP and the web almost to perfection, especially for a typical server-rendered web application. For page-oriented applications, Razor Pages can also be a contestant to this claim.
From the old ASP.NET MVC to ASP.NET Core, the MVC framework is cleaner, leaner, faster, and more flexible than ever before. Moreover, dependency injection is now built-in at the heart of ASP.NET, which helps leverage its power. We will be covering dependency injection in greater depth in Chapter 7, Deep Dive into Dependency Injection.
MVC is an opt-in feature now, like pretty much everything else. You can opt-in MVC, Razor Pages, or web APIs and configure them with only a few statements. The ASP.NET pipeline is based on a series of middleware that can be leveraged to handle...