Answer: Deep Copy is creating a new object and then copying the non static fields of the current object to the new object.
Example:
public object DeepCopy(object obj)
{
MemoryStream ms = new MemoryStream();
BinaryFormatter bf = new BinaryFormatter();
bf.Serialize(ms, obj);
object retval;
ms.Seek(0, SeekOrigin.Begin);
retval = bf.Deserialize(ms);
ms.Close();
return retval;
}
Found interesting? Add this to: