LINQ Grouping dynamically
问题 I have a class list of records, so user can select to group rows dynamically by property name. For example MenuText , RoleName or ActionName . Then I have to execute grouping so I need a generic method to handle grouping by passing column name. Example : public class Menu { public string MenuText {get;set;} public string RoleName {get;set;} public string ActionName {get;set;} } public class Menus { var list = new List<Menu>(); list.Add( new Menu {MenuText="abc",RoleName ="Admin", ActionName=