Hacker News new | ask | show | jobs
by Yuioup 1250 days ago
I banned Automapper from my company.
4 comments

For me, it's been great for mapping the Domain objects to API Response objects. I wouldn't recommend using it to map your Dto objects to your Domain objects. At the end of the day it helps to solve the problem of multiple API responses sourced from the same Domain object. For example, the "Product" object in a list of "Products" may not have the same fields as the "Product" object in the "Product Details".

I'm curious, what do you use for this use-case, if you have it, in your company?

(of course, everything is dependent on the particular project's needs)

So did I. Do the napping manually and let the type system actually help you instead of being invisible.
I haven't used it for years and I have never looked back! Even in extremely large systems, manually writing a mapping layer is quick (although admittedly obnoxious) and has helped me identify issues so much easier.
It's been many years since I was a (.NET) developer and therefore since I used automapper. Are there any VS plugins that take the tedium out of this mapping? Right click on a class, choose a class to map it to, and it creates the boilerplate code for the mapping layer?
Thank you. Now please ban it from planet earth.