Reputation: 4251
Imagine I have two very complex but identical objects in c#, and I want to copy, say 3 arbitaty fields from the first object to the second object.
Is their an optimal way of copy X arbitary fields between one object and other. This is done all over the shop. What is the optimal way of doing it.
I'm not looking for any info about cloning interface or memberwise method. Thanks Bob.
Upvotes: 0
Views: 209
Reputation: 1039160
You may take a look at AutoMapper which allows you to map different objects.
Upvotes: 4