Summary
In this chapter, we explored one part of ASP.NET Core 5 MVC, which allows us to create rich web user interfaces with Razor and C#.
We saw how to decouple the model from the presentation, using view models. View models are classes specially crafted around a view or a partial view. For example, rather than passing a data model to a view, and letting the view do some calculations, you instead do the calculation on the server side and pass just the results to the view. This way, the view only has one responsibility: displaying the user interface, the page.
Finally, we elaborated on the fact that it is imperative to reduce the tight coupling of our components in our systems, which follow the SOLID principles.
In the next few chapters, we will explore the web API counterpart to the MVC and View Models patterns. We will also look at our first Gang of Four (GoF) design patterns and deep dive into ASP.NET Core 5 dependency injection. All of that will push us further down the...