How to build group-by dynamically on a list of dictionaries
问题 I am trying to perform a groupby on an IEnumerable. The problem is that I do not know at compile-time which fields i want to groupby. I have found another post on stack that explains how to do this when the class is known and has properties, but in my case i am dealing with a dictionary and the keys are also only known at run-time. My code would resemble something like this (i know this doesn't compile...): private object GetValuesGroupedBy(List<string> groupbyNames, List<string>