LINQ query to navigate an object hierachy?

How about countryList. SelectMany(c => c. States).

SelectMany(s => s. Cities)? Or maybe this?

Var cities = from country in countryList from state in country. States from city in state. Cities select city.

Can't be simpler! :-) var cities = from country in countries //List from state in country. States from city in state.

Cities select city.Name.

Now its not as easy to chain navigations in Linq-to-XML as it is XPath. The problem is that navigation functions return collection objects, while the navigation functions are applied to non-collections. Consider the XPath expression which selects a table tag as an immediate child then any descendant table data tag.

I think this would look like ".

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions