Micah Armantrout
Micah Armantrout

Reputation: 6971

Linq to XML Order

When reading a XML file with linq to XML using a XDocument and there is no order by on the query can I rely the order in the IEnumerable that is returned ?

Upvotes: 2

Views: 218

Answers (1)

Kyle Trauberman
Kyle Trauberman

Reputation: 25684

Yes.

Look at the documentation for .Descendants(), for example. It says that the elements are returned in document order.

Upvotes: 3

Related Questions