Quantcast
Channel: XML, System.Xml, MSXML and XmlLite forum
Viewing all articles
Browse latest Browse all 935

How to Parse XML into a C# object?

$
0
0
I used the XmlWriter to create this string:

<EventInput>
          <Group>12345</Group>
<Events>
<Event Id="100" />
<Event Id="101" />
<Event Id="102" />
<Event Id="103" />
<Event Id="104" />
</Events>
</EventInput>

What would be the simplest way to read and parse this XML string into a C# object (I'm not showing the private members and properties for simplicity)

class EventInput
{
public int group;
        public List<int> EventIds = new List<int>();
}



Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>