I have an object (User) which is not marked as [Serializable()].
I need to convert the entire object (including child objects) to string.
This is an actual need to convert the object from a third party tool response which is not marked as [Serializable()].
How can i convert an entire C# object to string/xml of the above scenario?
The
XmlSerializerdoes not need theSerializableattribute, but it can only serialize public members.Best Regards
Oliver Hanappi
Edit: You can create your own adapter class, which implements the IXmlSerializable interface and represents one User object which your adapter gets when constructed.