Skip to main content

Timeline for answer to How to group by multiple columns using LINQ by Kai Hartmann

Current License: CC BY-SA 3.0

Post Revisions

8 events
when toggle format what by license comment
Jan 13, 2025 at 1:04 comment added CAD bloke Just use a delmiting character that can't be in the dataset, some weird ASCII control character
Nov 9, 2022 at 15:31 comment added Kai Hartmann @AlbertK yes, that is an instance that won't work, because both cases lead to the group key "abc de "...
Mar 15, 2019 at 19:24 comment added AlbertK what about "abc de" "" and "abc" "de "?
May 8, 2018 at 6:29 comment added Kai Hartmann "ab" "cde" should actually not match "abc" "de", hence the blank in between.
Apr 19, 2018 at 19:14 comment added Brandon Barkley This is a better answer than anyone is giving credit for. It may be problematic if there could be instances of combinations where column1 added to column2 would equal the same thing for situations where column1 differs ("ab" "cde" would match "abc" "de"). That said, this is a great solution if you can't use a dynamic type because you are pre-constructing lambdas after the group by in separate expressions.
Aug 1, 2017 at 7:51 comment added Kai Hartmann Combined with Linq.Enumerable.Aggregate() this even allows for grouping by a dynamic number of properties: propertyValues.Aggregate((current, next) => current + " " + next).
May 19, 2017 at 6:56 review Low quality answers
May 19, 2017 at 12:51
May 19, 2017 at 6:41 history answered Kai Hartmann CC BY-SA 3.0