Copy values from one object to another.

Posted by BrokeMyLegBiking on Stack Overflow See other posts from Stack Overflow or by BrokeMyLegBiking
Published on 2010-04-12T19:34:42Z Indexed on 2010/04/12 19:43 UTC
Read the original article Hit count: 182

Filed under:

Anyone have a suggestion for a good utility class that maps values from one object to another? I want a utility class that uses reflection and takes two objects and copies values from the 1st object to the second if there is a public property with the same name.

I have two entities that are generated from a web service proxy, so I can't change the parent class or impliment an interface or anything like that. But I know that the two objects have the same public properties.

© Stack Overflow or respective owner

Related posts about c#