I am trying to convert XML to list
<School> <Student> <Id>2</Id> <Name>dummy</Name> <Section>12</Section> </Student> <Student> <Id>3</Id> <Name>dummy</Name> <Section>11</Section> </Student> </School>
I have tried several things using LINQ, and I do not really understand what is going on.
dox.Descendants("Student").Select(d=>d.Value).ToList();
Gets counter 2, but values โโas 2dummy12 3dummy11
Is it possible to convert the above XML into a generic list of type Student that has the properties Id, Name and Section?
How can I implement this?
c # xml-parsing linq
user2067567
source share