views:

59

answers:

1

There is a Select overload that adds an index to each element of a sequence :

Dim Letters = new string() {"a","b","c","d","e"}
Dim IndexedLetters = Letters.Select(function (aLetter, index) new with {.Index = index + 1, .Letter = aLetter})

' For LINQPad users : IndexedLetters.Dump

Can this query be written in Query Notation ?

+1  A: 

No untfortunately it cannot. The Select overload you mentioned is not one of the Select overloads that the VB.Net (or C#) compiler will bind to in query notation. You must write this one out by hand as your example shows.

JaredPar