J'essaie d'obtenir le bit de code suivant pour travailler dans LINQPad mais je suis incapable d'indexer dans un var. Quelqu'un sait comment indexer dans un var dans LINQ?Comment indexez-vous un var dans LINQ?
string[] sa = {"one", "two", "three"};
sa[1].Dump();
var va = sa.Select((a,i) => new {Line = a, Index = i});
va[1].Dump();
// Cannot apply indexing with [] to an expression of type 'System.Collections.Generic.IEnumerable<AnonymousType#1>'