Model–view–controller (MVC) is an architectural pattern that separates application concerns into models, views, and controllers. It emerged as an alternative to Web Forms, embracing the behavior of HTTP and HTML instead of hiding it behind a desktop-style programming model. section 1.1.1
In ASP.NET Core, the three parts divide responsibilities:
- Models provide the data model used by the application. section 19.4
- Controllers organize request handling and can define a web service in a single class. section 19.4
- Views produce HTML responses, including responses rendered with Razor. section 19.4
Controller-based web service
A controller can keep related response work together instead of repeating it across URL endpoints: obtain the Entity Framework Core service, query the database, set the response Content-Type, and serialize objects as JSON. This keeps Program.cs from becoming unwieldy. section 19.4
MVC remains useful, but it is no longer the only organizing style in ASP.NET Core. Single-page applications and other approaches can reduce the need to follow the full pattern, while controllers still support web services and MVC controllers with views support form applications. section 1.1.1 section 19.4 section 31.2



