System.LINQ.Dynamic: Select(“ new (…)”) into a List<T> (or any other enumerable collection of <T>)
- 阅读更多 关于 System.LINQ.Dynamic: Select(“ new (…)”) into a List (or any other enumerable collection of )
Say I have a DataTable with four columns, Company (string), Fund (string), State (string), Value(double): 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)); I want to use System.LINQ.Dynamic to build a dynamic query which groups on either Company, Fund, or State, and then selects my group by criteria as the