Closed bzuillsmith closed 8 years ago
Seems to be specific to that signature of .Map
because var a3 = mapper.Map<AClass, AClass>(a);
works properly.
Dear @bzuillsmith, Thanks for your input! Mapping with destination and without destination is different compiled code. Mapping without destination less heavy, mapping with destination - tries to reuse existing object on destination side. But in case you map with destination the same type - it should work like a deep copy. Let me check and I'll get back to you ASAP.
Thanks.
Dear @bzuillsmith,
Actually the should be the same as you are using mapping with destination: mapper.Map(a, a2);
.
If you want deep copy then use var a2 = mapper.Map(a);
Let me know if you have any concerns.
Thanks, Yuriy
Ah, I see. I wanted to do a deep copy using mapper.Map(a, this)
but perhaps I can do it in two steps: mapper.Map(mapper.Map(a), this)
? I'll give it a try. Thanks
Yeah I think you are on a right way.
It'd be interesting to compare that deep cloning method to other high performance libraries.
Sure @shay1e - after all p1 - I'll do it :)
Thanks!
@anisimovyuriy Hi,was ExpressMapper support Deep Copy now? i seen a project can do it. https://github.com/ReubenBond/DeepCopy
Maybe I'm missing something obvious or mistaken about how this should code function. The code below shows a test of the
.Map(src, dest)
functionality. The Assert fails. Why?