我正在转换C#这个LINQ表达式.但是,它似乎不起作用.
C#
return (from w in fishSticks group w by w.FishQty into g orderby g.Key descending select g).First().First();
VB
Return (From w In fishSticks Group w By w.FishQty Into g() Order By g.Key Descending Select g).First().First()
Visual Studio将g转换为Into g()本身,然后给出了这个错误:
Definition of method ‘g’ is not
accessible in this context.
有任何想法吗?
VB.Net has different group syntax
正确的语法是
Dim q = (From w In fishSticks Group By Quantity = w.FishQty Into g = Group Order By Quantity Descending Select g).First().First()