With the exception of 3rd party mapper applications like Automapper, what is the best way to copy data from one object to another object that have limited properties (not exactly a clone task).
Customer
{
string Name { get; set; }
string SSN { get; set; }
object Addresses { get; set; }
}
to
CustomerData
{
string Name { get; set; }
object Addresses { get; set; }
}
For example, I want to copy Customer
to CustomerData
(Addressses object might be a nested object, and object may have more properties). This, of course, is shortened for demo purposes. There are a lot more fields in Customer that I don't want copied to CustomerData.