c# copy constructor generator

Posted by Shawn Mclean on Stack Overflow See other posts from Stack Overflow or by Shawn Mclean
Published on 2010-03-26T08:45:57Z Indexed on 2010/03/26 8:53 UTC
Read the original article Hit count: 358

Filed under:

I want to copy values from one object to another object. Something similiar to pass by value but with assignment.

Eg.

PushPin newValPushPin = oldPushPin; //I want to break the reference here.

I was told to write a copy constructor for this. But this class has alot of properties, it will probably take an hour to write a copy constructor by hand.

  1. Is there a better way to assign an object to another object by value?
  2. If not, is there a copy constructor generator?

© Stack Overflow or respective owner

Related posts about c#