There is such code:
var query = from data in db.GetTable<TableClass>() group data by new { data.Organisation, data.City } into result select new { Organisation = result.Key.Organisation, City = result.Key.City, Quantity = result.Sum(i => i.Quantity), Summa = result.Sum(i => i.Summa) }; How can you make it so that you can dynamically change the fields by which they are grouped. For example:
var query = from data in db.GetTable<TableClass>() group data by new { data.Manager, data.Organisation, data.Date } into result select new { Manager = result.Key.Manager; Organisation = result.Key.Organisation, Date = result.Key.Date, Quantity = result.Sum(i => i.Quantity), Summa = result.Sum(i => i.Summa) };