The Model View Controller design pattern
Now that we have explored the basics of ASP.NET Core MVC in Chapter 4, The MVC Pattern Using Razor, and REST, it is time to jump into ASP.NET Core web APIs and return data instead of a user interface.
In the past few years, the number of web APIs just exploded to a gazillion; everybody builds APIs nowadays, not because people are blindly following a trend but based on good reasons. Here are a few examples of what makes web APIs so appealing:
- It is an efficient way of sharing data between systems.
- It allows interoperability between technologies by dialoguing in universal languages, such as JSON or XML.
- It allows your backend to be centralized and shared with multiple frontends such as mobile, desktop, and web applications.
- It allows you to gate (secure, protect, or hide) downstream systems, with APIs acting as gateways.
- It allows the encapsulation of units of logic in reusable, independent, and possibly...