Overview of object mapping
What is object mapping? In a nutshell, it is the action of copying the value of an object's properties into the properties of another object. But sometimes, properties' names do not match; an object hierarchy may need to be flattened, and more. As we saw in the previous chapter, each layer can own its own model, which can be a good thing, but that comes at the price of copying objects from one layer to another. We can also share models between layers, but we will need some sort of mapping at some point. Even if it's just to map your models to DTOs or view models, it is almost inevitable, unless you are building a tiny application, but even then, you may want or need DTOs and view models.
Note
Remember that DTOs define your API's contract. Having independent contract classes should help you maintain a system, making you choose when to modify them. If you skip that part, each time you change your model, it automatically updates your...