Class Person
{
string Name
int yesno
int Change
List<Cars> Personcars;
houses Personhouses
}
Person user1 = new Person()
Person user2 = new Person()
user1.Name = "userName"
user2.Name ="";
user2.cars[0] = new car("Mazda");
user1.cars[0] = new car("BMW");
i want to merge the objects so that user2 will take the name and the car from user1
user2 will have this values
user2.Name will be userName user2.cars will hold the Mazda and the Bmw
thanks !
You could add this as a method on the class itself:
Which will allow you to write something like this:
Try this extension methods