vb.net Code:
public class FeedDefinition { public string Name { get; set; } public string Url { get; set; } } public List<FeedDefinition> LoadFeeds(string path) { XDocument feedXML = XDocument.Load(path); var feeds = from feed in feedXML.Descendants("Feed") select new FeedDefinition { Name = feed.Element("Name").Value, Url = feed.Element("Url").Value }; return feeds.ToList(); }
This code returns a list with each element queried from the feed, how does it "work"? In other words, first the names and then the Urls? How?
Thanks in advance.
I've attached a picture of the xml file model.
It was obtained from here.





Reply With Quote