Automapper vs Mapster

AutoMapper is undoubtedly the most popular object to object mapping library used around and it wouldn't be a surprise to know if any of us, including yours truly, have even tried out alternatives. I recently tried out Mapster and was quite surprised by the results. Even they did mention their Github pages about being faster than Automapper, I honestly didn't believe … Continue reading Automapper vs Mapster

Automapper – Use IoC for creating Destinations

Automapper by default creates new instances of destination using the default contructor. If you need to ask the IoC to create the new instance, it actually turns out to be pretty simple. We will begin by setting up our Unity Container to register the IMapper. As you can see, you are also initializing the Automapper … Continue reading Automapper – Use IoC for creating Destinations

Mapping XML Using Automapper

Automapper comes handy when you have to deal with a lot of DTOs, making it very easy to map one type to another. But there are situations where you might need an extra hand. Consider the following Type definitions. The Source.Address is a XML representation of Address. Your requirement is to configure Automapper to convert … Continue reading Mapping XML Using Automapper