Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
map nodes/attributes to Pocos (plain old compiled objects)Can you explain what you mean by parsing the Document into full ojects?
public class Foo
{
public int Number {get;set;}
public string Text {get;set;}
public DateTime Date {get;set;}
}
public class Mapper
{
public Foo MapFrom(XmlNode node)
{
Foo foo = new Foo();
foo.Number = int.Parse(node.Attributes["id"]);
foo.Text = node.Value;
foo.Date = DateTime.Parse(node.Attributes["TimeStamp");]
}
}
public class FooService
{
public List<Foo> GetAll(IComparer<Foo> sorting)
{
List<Foo> foos = new List<Foo>();
foreach(XmlNode node in xmlDoc.Nodes)
{
foos.Add(mapper.MapFrom(node);
}
foos.Sort(sorting);
return foos;
}
}