using System.Collections.Generic;
using System.Data.Entity;
using System.Linq.Dynamic.Core;
public static void Main()
GroupByMany_Dynamic_LambdaExpressions();
GroupByMany_Dynamic_StringExpressions();
private static void GroupByMany_Dynamic_LambdaExpressions()
Console.WriteLine(nameof(GroupByMany_Dynamic_LambdaExpressions));
var lst = new List<Tuple<int, int, int>>
new Tuple<int, int, int>(1, 1, 1),
new Tuple<int, int, int>(1, 1, 2),
new Tuple<int, int, int>(1, 1, 3),
new Tuple<int, int, int>(2, 2, 4),
new Tuple<int, int, int>(2, 2, 5),
new Tuple<int, int, int>(2, 2, 6),
new Tuple<int, int, int>(2, 3, 7)
var sel = lst.AsQueryable().GroupByMany(x => x.Item1, x => x.Item2).ToList();
FiddleHelper.WriteTable(sel);
FiddleHelper.WriteTable(sel[0].Items);
FiddleHelper.WriteTable(sel[0].Subgroups);
private static void GroupByMany_Dynamic_StringExpressions()
Console.WriteLine(nameof(GroupByMany_Dynamic_StringExpressions));
var lst = new List<Tuple<int, int, int>>
new Tuple<int, int, int>(1, 1, 1),
new Tuple<int, int, int>(1, 1, 2),
new Tuple<int, int, int>(1, 1, 3),
new Tuple<int, int, int>(2, 2, 4),
new Tuple<int, int, int>(2, 2, 5),
new Tuple<int, int, int>(2, 2, 6),
new Tuple<int, int, int>(2, 3, 7)
var sel = lst.AsQueryable().GroupByMany("Item1", "Item2").ToList();
FiddleHelper.WriteTable(sel);
FiddleHelper.WriteTable(sel[0].Items);
FiddleHelper.WriteTable(sel[0].Subgroups);