I implemented a deep copy of the object, making my objects serializable [Serializable()]and using the following method.
public static ObjectType CopyObject<ObjectType>(ObjectType oObject)
{
XmlSerializer oSeializer = null;
oSeializer = new XmlSerializer(oObject.GetType());
using (MemoryStream oStream = new MemoryStream())
{
oSeializer.Serialize(oStream, oObject);
oStream.Position = 0;
return (ObjectType)oSeializer.Deserialize(oStream);
}
}
source
share