public static LocationEntity MakeEntityCopy(LocationEntity entityToIsolate) { MemoryStream stream = new MemoryStream(); IFormatter formatter = new BinaryFormatter(); formatter.Serialize(stream, entityToIsolate); stream.Seek(0, 0); LocationEntity IsolatedEntity = (LocationEntity)formatter.Deserialize(stream); stream.Close(); return IsolatedEntity; }Option Two
public static LocationEntity MakeEntityCopy(LocationEntity entityToIsolate) { MemoryStream stream = new MemoryStream(); BinaryFormatter bf = new BinaryFormatter(); bf.Serialize(stream, entityToIsolate); stream.Position = 0; LocationEntity IsolatedEntity = (LocationEntity)bf.Deserialize(stream); stream.Close(); return IsolatedEntity; }Is there anything obvious I am missing?