An MVC controller receives user input or an HTTP request, coordinates the model and view, and produces the response. Its actions handle distinct requests and return results such as HTML, JSON, images, or status codes. section 3.2.1 section 3.1.2
In ASP.NET Core, controllers fit into several related request-handling styles:
- A conventional MVC controller is a class whose action methods handle unique requests and select the model and view. section 3.1.2
- A Razor page combines view and controller responsibilities for simple page interactions, while keeping application data and logic separate. section 3.2.1
- Minimal APIs create actions directly with methods such as app.MapGet, avoiding an explicit controller class. section 3.1.2
- Controllers can perform CRUD operations through Entity Framework Core, while asynchronous techniques help avoid blocking application threads during database requests. section 5.6
Selecting an HTTP result
A request for ASCII art can return content when the requested font exists and a 404 Not Found result when it does not. The conditional minimal-API endpoint demonstrates the same action-result decision without a controller class. section 3.1.2
Diagram of the MVC pattern in which the user request goes to the controller, which can update the model and get the latest view to send in the response
Follow the request-to-controller-to-model/view flow, including the resulting response. section 3.2.1







