I'd like to use Linq to XML to output a sorted list each element should contain a value and its index on that list.
In other words I would like to do something like this (xml stuff was striped out):
var Sample = new[] { "4", "3", "2", "1" }.AsQueryable();
var r = (from o in Sample orderby o select new {obj=o, idx=?});
I'm not sure how to calculate idx.
Is that possible or should I use foreach loop?