Given this xml document:
<projects><project><name>sample project</name><location>http://somewhere.com/</location></project></projects>
And this linq to xml statement for retrieving name/location elements and creating a new Project object:
return xmlDocumentFromAbove.Descendants("project").Select(p => new Project(p.Element("Name").Value, p.Element("Location").Value));
I keep getting a NRE where I am accessing p.Element("Name").Value. Am I missing something obvious here?
Thanks!