说我有一个DataTable与四列公司(string),基金(string),国家(string),价值(双): table1.Rows.Add("Company 1","Fund 1","NY",100)); table1.Rows.Add("Company 2","Fund 1","CA",200)); table1.Rows.Add("Company 3","Fund 1","FL",300)); table1.Rows.Add("Company 4","Fund 2","CA",400)); table1.Rows.Add("Company 5","Fund 1","NY",500)); table1.Rows.Add("Company 6","Fund 2","CA",600)); table1.Rows.Add("Company 7","Fund 3","FL",700)); 我想要使用System.LINQ.Dynamic构build一个dynamic查询,这个查询在公司,基金或者状态上进行分组,然后按照标准select我的组作为第一列,然后求和(value): string groupbyvalue="Fund"; var q1= table1.AsEnumerable().AsQueryable() .GroupBy(groupbyvalue,"it") .Select("new ("+groupbyvalue+" as Group, Sum(Value) as TotalValue)"); 在上面的查询中,所选的groupbyvalue(Group)将始终是一个string,总和将总是一个double,所以我想能够转换成类似List的东西,其中Result是具有属性的对象Group(string )和TotalValue(双)。 我遇到了很多麻烦,谁能解释一下?