Fastest Way to do Shallow Copy in C#
I wonder what is the fastest way to do shallow copying in C#? I only know there are 2 ways to do shallow copy: MemberwiseClone Copy each field one by one (manual) I found that (2) is faster than (1). I'm wondering if there's another way to do shallow copying? Nick Stamas This is a complex subject with lots of possible solutions and many pros and cons to each. There is a wonderful article here that outlines several different ways of making a copy in C#. To summarize: Clone Manually Tedious, but high level of control. Clone with MemberwiseClone Only creates a shallow copy, i.e. for reference