The MVC design pattern
Now that we have explored the basics of REST and minimal APIs, it is time to explore the MVC pattern to build ASP.NET Core REST APIs.
MVC is a design pattern commonly used in web development. It has a long history of being used to build REST APIs in ASP.NET and is widely used and praised by many.
As previously established, this pattern divides an application into three interconnected components: the model, the view, and the controller. A view in MVC formerly represented a user interface. However, in our case, the view is a data contract that reflects the REST API’s data-oriented nature.
Dividing responsibilities this way aligns with the Single Responsibility Principle (SRP) explored in Chapter 3, Architectural Principles. However, this is not the only way to build REST APIs with ASP.NET Core, as we saw in Chapter 5, Minimal APIs.
The new minimal API model mixed with the Request-EndPoint-Response (REPR) pattern can make building...