【发布时间】:2016-01-12 00:44:23
【问题描述】:
我正在尝试使用组连接和 VB.NET 将表连接到自身。下面的代码可以工作并对外部(父)行进行排序,但我想保证内部(子)行的顺序:
Dim queryEthnicities = From aParentEthnicity In edata.Ethnicity _
Group Join aChildEthnicity In edata.Ethnicity On aChildEthnicity.ParentID Equals aParentEthnicity.EthnicityID Into EthnicityList = Group _
Where aParentEthnicity.RoundID.Equals(aRoundID) Order By aParentEthnicity.Sort
我在Ordering inner keysource in simple/unnamed C# LINQ group join 找到了与 C# 类似的东西 但还没有找到在 VB 中执行此操作的方法 - 感谢任何想法。
【问题讨论】:
-
你能提供一个minimal reproducible example吗?现在我无法运行和测试你的代码来给你答案。