Suppose:
var a = SomeCollection.OrderBy(...)
.Select(f => new MyType
{
counter = ? //I want counter value, so what first
//object have counter=1, second counter=2
//and so on
a=f.sometthing,
...
});
How do I set this counter value? Or do I fave to iterate a afterwards?
Use the overload of Select that gives you the current element’s 0-based index.