December 2019
Intermediate to advanced
510 pages
11h 33m
English
This subsection and the following one describe the implementation of two mapping approaches we can use in our application: the manual approach and the reflection approach.
The manual approach involves the definition and implementation of our own mapper classes:
using Catalog.Domain.Entities;using Catalog.Domain.Requests.Item;using Catalog.Domain.Responses;namespace Catalog.Domain.Mappers{ public interface IItemMapper { Item Map(AddItemRequest request); Item Map(EditItemRequest request); ItemResponse Map(Item item); }}
The preceding code defines an IItemMapper interface, which provides two methods to map AddItemRequest and EditItemRequest in the Item type. In addition, it also defines the mapping method signature ...