The Model View Controller design pattern
When using ASP.NET Core MVC, there are two broad usages of the MVC framework:
- The first use is to display a web user interface, using a classic client-server application model where the page is composed on the server. The result is then sent back to the client. To build this type of application, you can use Razor, which allows developers to mix C# and HTML to build rich user interfaces elegantly. From my perspective, Razor is the technology that made me embrace MVC in the first place when ASP.NET MVC 3 came out in 2011.
- The second use of MVC is to build web APIs. The presentation (or the view) becomes a data contract in a web API instead of a user interface. The contract is defined by the expected input and output, as with any API. The most significant difference is that a web API acts as a remote API. Essentially, inputs and outputs are serialized data structures, usually JSON or XML, mixed with HTTP verbs such as
GET
and...