需要帮助将此linq查询转换为表达式树
Dim query = (From _row In table.Rows
Group _row By vGroup = _row("VENDOR")
Into VendorGroup = Group
Select New With {
Key vGroup,
.PI = VendorGroup.Sum(Function(r) r("PI")),
.ST = VendorGroup.Sum(Function(r) r("ST")),
.IS = VendorGroup.Sum(Function(r) r("IS")),
.RR = VendorGroup.Sum(Function(r) r("RR"))
}).ToList
答案 0 :(得分:2)
您可以尝试转换为IQueryable
,然后取出Expression
媒体资源:
Dim expression = (From _row In table.Rows
Group _row By vGroup = _row("VENDOR")
Into VendorGroup = Group
Select New With {
Key vGroup,
.PI = VendorGroup.Sum(Function(r) r("PI")),
.ST = VendorGroup.Sum(Function(r) r("ST")),
.IS = VendorGroup.Sum(Function(r) r("IS")),
.RR = VendorGroup.Sum(Function(r) r("RR"))
}).AsQueryable()
.Expression
但您获得的表达式可能会因您使用的查询提供程序而异。