scope_creep
scope_creep

Reputation: 4251

What is the optimal way to copy data between two identical objects

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

Answers (1)

Darin Dimitrov
Darin Dimitrov

Reputation: 1039160

You may take a look at AutoMapper which allows you to map different objects.

Upvotes: 4

Related Questions