Category: Exams of ASP.NETPage 3 of 3

Project – Mapperly – Object Mappers, Aggregate Services, and Façade-1

Mapperly is a newer object mapper library that leverages source generation to make it lightning-fast. To get started, we must add a dependency on the Riok.Mapperly NuGet package….

Project – AutoMapper – Object Mappers, Aggregate Services, and Façade-2

Since we have only one profile in one assembly, we leverage that class to access the assembly by passing the typeof(WebProfile).Assembly argument to the AddAutoMapper method. From there,…

Project – AutoMapper – Object Mappers, Aggregate Services, and Façade-1

We just covered different ways to implement object mapping, but here we leverage an open-source tool named AutoMapper that does it for us instead of implementing our own.Why…

Project – Mapping service – Object Mappers, Aggregate Services, and Façade

The goal is to simplify the implementation of the Mapper façade with a universal interface. To achieve this, we are implementing the diagram shown in Figure 13.3. Here’s…

Pattern – Mapping Façade – Object Mappers, Aggregate Services, and Façade

We studied façades already; here, we explore another way to organize our many mappers by leveraging that design pattern.Instead of what we just did, we will create a…

Pattern – Aggregate Services – Object Mappers, Aggregate Services, and Façade

Even if the Aggregate Services pattern is not a magic problem-solving pattern, it is a viable alternative to injecting too many dependencies into another class. Its goal is…

Conclusion – Object Mappers, Aggregate Services, and Façade

Before exploring more alternatives, let’s see how object mapping can help us follow the SOLID principles: Now that we’ve explored how to extract and use mappers, let’s look…

Design – Object Mappers, Aggregate Services, and Façade-2

The preceding code is straightforward; the ProductMapper class implements the IMapper<Product, ProductDetails> interface. The Map method returns a ProductDetails instance. The highlighted code ensures the Id property is…

Design – Object Mappers, Aggregate Services, and Façade-1

We can design object mappers in many ways. Here is the most basic object mapper design:  Figure 15.1: Basic design of the object mapper  In the diagram, the…

Object mapper – Object Mappers, Aggregate Services, and Façade

Before you begin: Join our book community on Discord Give your feedback straight to the author himself and chat to other early readers on our Discord server (find…