✅ Why some people don’t like Automapper?
I’ve learned about this tool about a month ago, since then I’ve been constantly using it without any problems. But some people thinks that it is unnecessary, and I’m curious why. Is there any significant disadvantages to this approach for mapping?
7 Replies
1. It gives you errors on mapping in runtime rather than compile-time. This makes iterations longer. You can kinda circumvent this with a test, but it's still way slower than getting a compile time error and knowing exactly where that is.
2. It's slow.
3. It allows you to introduce dependecies and business logic into the mapper, which is bad practice.
Because you just limit your ability to write a proper response object and half the time you end up having to manually insert hacks or configuration anyway
It's also very easy to make a static/instanced method on the class to convert it back and forth
Unknown User•3w ago
Message Not Public
Sign In & Join Server To View
You can also use something like
Riok.Mapperly
that does the same thing, but via source generators. So code flow can be tracked and errors are on compile time, since it generates real code instead of using reflectionsUnknown User•3w ago
Message Not Public
Sign In & Join Server To View
If you have no further questions, please use /close to mark the forum thread as answered
Thanks for answers!