0
C# class to XML and back to the class
Hello, I was wondering the best way to serialize a public class to an XML file and then de-serialize back to the same class. Thank you
1 Answer
0
The best way (as I think) is to create abstract class with two methods - toXml() and fromXml(). First one will output XML object with serialized object (probably simple array with public properties and their values) and the second that takes XML object as a parametr and which produces instance of that object with public properties correctly set.
You will use this new class as a parent for others which you want to serialize.