.Net Deep cloning - what is the best way to do tha

2020-01-31 03:45发布

I need to perform deep cloning on my complex object model. What do you think is the best way to do that in .Net?
I thought about serializing / Deserializing
no need to mention that MemberwiseClone is not good enough.

标签: c# .net clone
7条回答
Viruses.
2楼-- · 2020-01-31 04:16

Best way to implement this manually. It will be really faster than any other generic methods. Also, there are a lot of libraries for this operation (You can see some list with performance benchmarks here).

By the way, BinaryFormatter is very slow for this task and can be good only for testing.

查看更多
登录 后发表回答