-6

我需要转换 Linq 查询的帮助。我试过在线转换工具,但没有运气......查询是这样的:

var orderedData =(from d in collezione
              group d by d.Gruppo into g
              orderby g.Key
              from d in g
 select new[] {d}.Union(g.Where(c => c.Owner == d.Comp)) into withChildren
                          from wc in withChildren
                          orderby wc.Pos
                          select wc).Distinct();
4

1 回答 1

2

我不确定这是否是您需要的(这是随机拍摄,因为您的问题不完整):

Dim orderedData = From d In collezione
                  Order By d.Gruppo
                  Group d By d.Gruppo Into g = Group
                  From d In g
                  Select New With {
                      .withChildren = {d}.
                          Union(g.Where(Function(c) c.Owner = d.Comp))
                  }
Dim result = (From od In orderedData
              From wc In od.withChildren
              Order By wc.Pos
              Select wc).Distinct
于 2012-04-11T14:49:37.693 回答