I am trying to convert XML to List
2
dummy
12
var students = from student in dox.Descendants("Student")
select new
{
id=d.Element("Id").Value,
Name=d.Element("Name").Value,
Section=d.Element("Section").Value
}).ToList();
or you can create a class call Student with id, name and section as properties and do:
var students = from student in dox.Descendants("Student")
select new Student
{
id=d.Element("Id").Value,
Name=d.Element("Name").Value,
Section=d.Element("Section").Value
}).ToList();