Taswar Bhatti
Practical guides on AI agents, LLM security, C#/.NET and Cloud, from Taswar Bhatti
Tag: object mapping
automapper

In this last part of the series I wanted to talk about how to register automapper at startup of your web application, in doing so it would help speed things up with automapper.

There are many ways to do it, the easiest way is to just have a method inside Global.asax.cs file in your Application_Start like below

… Read the rest “Automapper: Mapping Objects Part 7 of 7 (Startup Registration)”
automapper

In this part I will show how we can use a customer value formatter (CustomFormatter) to format our mapped data into single “Number of Order:” and plural “Number of Orders:”.

First the Domain and Dto (data transfer object)

… Read the rest “Automapper: Mapping objects Part 6 of 7 (CustomFormatter)”
automapper

In Part 5, we will use a powerful feature that automapper allows us, which is CustomResolver.

Lets look at our Domain Object which contains a boolean field called ShipToHomeAddress, what we will do is map those boolean to a string value with “Yes” or “No”.

… Read the rest “Automapper: Mapping objects Part 5 of 7 (CustomResolver)”
automapper

In Part 4 we will see how we can use projection to map inner objects for example a DateTime field.

Again our domain and Dto (Data Transfer Object) looks like

… Read the rest “Automapper: Mapping objects Part 4 of 7 (Projection)”
automapper

In this part we learn about Nested Mapping in Automapper and we will use the same OrderDto Object that we had previously but we will let Automapper to map the inner objects.

Once again here is the Domain Objects First

… Read the rest “Automapper: Mapping objects Part 3 of 7 (Nested Mapping)”
UA-4524639-2