Vb.net 带索引的Select重载的查询表示法

Vb.net 带索引的Select重载的查询表示法,vb.net,linq,select,Vb.net,Linq,Select,有一个Select重载,用于向序列的每个元素添加索引: 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 这个查询可以用查询符号来写吗?不,

有一个Select重载,用于向序列的每个元素添加索引:

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

这个查询可以用查询符号来写吗?

不,但它不能。您提到的Select重载不是VB.Net(或C#)编译器将在查询表示法中绑定到的Select重载之一。正如你的例子所示,你必须手工写出这一条