Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static object DeepClone(object obj)
- {
- object objResult = null;
- using (MemoryStream ms = new MemoryStream())
- {
- BinaryFormatter bf = new BinaryFormatter();
- bf.Serialize(ms, obj);
- ms.Position = 0;
- objResult = bf.Deserialize(ms);
- }
- return objResult;
- }
Advertisement
Add Comment
Please, Sign In to add comment