Clone creates a seperate copy of the object so this is OK and you need to do it, There is no other way to directly pass a ref type as value to some function.
objects of classes are shellow copied when passed to some functions or assigned to some other object.
Shellow Copying: Only Reference is copied not completely the object.
Deep Copying: The whole object is replicated as in case of value types.
Best Regards,
Rizwan
|