c# - How to use OrderBy in Linq using xpath -


i have 2 ienumerable<xpathnavigator> , want sort child value.

item1 = xpathnavigator item in iterator1 select item;   item2 = xpathnavigator item in iterator2 select item;  item1 = item1.union(item2);  item1.orderby(res => int.parse(getnavigatorvalue(res, "./item[@value='parentid']")));  static string getnavigatorvalue(xpathnavigator iterator, string xpath) {     xpathnodeiterator inner = iterator.select(xpath);    inner.movenext();    return inner.current.value; } 

it doesn't work.

how use orderby in linq if need sort xpath?

thanks, user460397

is problem? shouldn't be

item1 = item1.orderby( ... ); 

?


Comments

Popular posts from this blog

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

c++ - Convert big endian to little endian when reading from a binary file -