Serialize a List to XML

Here is a very good simple way to convert a list of objects to XML.

First, create a class for your list of objects. This class could be declared next to your routine if it is just to capture query results for example.

Here is an example of populating the list from a BC AX query.

And… heres the routine to convert this list to XML.

And… finally to Deserialize the XML data;

 

This entry was posted in C# Development. Bookmark the permalink.