Is there an "easy" way to implement something like CopyTo()
to MemberwiseCopy
(instead of Clone()
or MemberwiseClone
) in C#? I don t want to create a new object, as I want everyone holding the old one to be able to see the attributes of the new one, which may be completely different. While most of these derive from a parent class which could hold some abstract function, I don t want to write a few hundred lines of code just to copy every member one by one. Which may need to be copied over all (bad design, but its not mine, nor is it being rewritten). It seems like Microsoft would have created an interface for this or have I greatly missed out on something?
What is the use of default keyword in C#? Is it introduced in C# 3.0 ?