>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; >} >>
>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; >} >>