AutoMapper Beginner Question: I was hoping AutoMapper would let me merge properties from a DTO back into an existing business object. I don't see anything like that. AutoMapper.Map() generates a new object and populates it, but I need to copy DTO changes back into the original business object. Is there an Map function that takes a source and target object?
If you have to do complex mapping behavior, it might be better to avoid using AutoMapper for that scenario. Reverse mapping can get very complicated very quickly, and unless it's very simple, you can have business logic showing up in mapping configuration.
Automapper is considerably faster when mapping a List<T> of objects on . NET Core (It's still slower on full . NET Framework).
AutoMapper is one of the popular object-object mapping libraries with over 296 million NuGet package downloads. It was first published in 2011 and its usage is growing ever since. Mapster is an emerging alternative to AutoMapper which was first published in 2015 and has over 7.4 million NuGet package downloads.
AutoMapper supports polymorphic arrays and collections, such that derived source/destination types are used if found.
The Map method is overloaded. You can use Map(src, dst).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With