Group by key

The key projector is just a function that operates on the list to be sorted. Take, for example, a list of points, and I want to group them by they x-coordinate.

Capture

Also check out this thread: http://dynamobim.org/forums/search/group+by+key/, which uses an alternate technique in the case where the logic you are grouping items by is not directly related to the items themselves.