Any advantage to using the build-in mapper over AutoMapper? Why not just incorporate AutoMapper? Or suggest that your users use it? Updated at 16.07.2010 20:56:51And is there an example of the built-in mapper? I can't seem to find how to use it. Moreover, the one-to-one mapping limitation is a big problem, IMHO. In ASP.NET MVC, for example, one might have a CustomerViewModel, CustomerEditModel, CustomerIndexModel, etc... and each of these have their own mappings. This thread was imported from our support forum. The original discussion may contain more detailed answer. |
If it's about O2O (object-to-object) mapping, build-in mapper is capable of extracting the changes made to graph produced by it. AutoMapper can't do this - they ignored this part at all. Concerning examples: tests for it seems the only helpful thing here, see http://goo.gl/Pj4a I can add I thought about refactoring its mapping API - I dislike it, because it uses .MapType (single method) instead of .Map(...).To(...) (method chain), that makes mapping configuration completely unreadable. There is an issue for this: http://code.google.com/p/dataobjectsdot ... ail?id=623 - discussion there is in Russian (just copy-paste from Skype), may be Google Translate will help, if you need more details about this refactoring. IMHO, this is the main disadvantage it has - unreadable fluent configuration API. > Moreover, the one-to-one mapping limitation is a big problem, IMHO. O2O mapper doesn't have this limitation: you can build custom mappings for any particular case. All you need is to build a particular mapping configuration invoking .MapType for DTOs you'd like to map. Btw, it worth to mention it relies on convention over configuration while mapping fields:
|