How it works...

When you run the console application, you will find that it creates an XML document at the path you specified in the code. Viewing this XML document, you can see that the XML elements are defined exactly as we specified on the class by using the attributes. Note that the FundamentalsOfProgramming root element has the RoomNumber field as an attribute. The field ClassAverage has been ignored and is not present in the XML. Lastly, you can see how nicely the List<Student> object has been serialized to the XML file.

On deserialization of the XML, you will notice that the serialized values are displayed. ClassAverage; however, does not have a value as it was never serialized to begin with.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.119.170