How to Deserialize to a specific object instance.

  • Thread starter Thread starter MP
  • Start date Start date
M

MP

Hi,
I would like to be able to deserialize a stream to a specific instance.
Deserialize returns me a new instances and that is not really what we need,
we need to deserialized to an existing instance. Can anyone point me in the
rigth direction?


Regards

-Martin
 
when deserialize(re-hydrate) an object from an XML stream it creates a new
instance of the type so therefore it will have a completely different hash
code (GetHashCode()). If you want to map this onto an already existing
instance of the type you will have to do this after the deserialization has
been compeleted.

HTH


Ollie Riches
 
Thank you Ollie,
Then the obvious question is: Is there a simple way map one instance of
an object onto another? Kind of a copy operator....

Thank you again.

-Martin
 
Back
Top