I have the following XML in a string:
<RootElement>
<Data>
<Row>
<id>1</id>
<name>Foo</name>
</Row>
<Row>
<id>2</id>
<name>Bar</name>
</Row>
.
.
.
</Data>
</RootElement>
And the following class:
public class BusinessObject
{
public int Id { get; set; }
public string Name { get; set; }
}
How can i parse all the data in the Row elements to an IList ( in C# ) ?
I searched the internet a few hours but couldn’t find anything to solve this problem.
Thanks in advance for your answers
One option, using LINQ to XML: