How to get maximum Id in List and then return list
问题 I have a structure like this: No ID Name Status 1 1 A 1 2 1 B 1 3 1 c 1 4 1 D 1 5 2 E 3 6 2 F 3 7 2 G 3 I want to run a linq when I get a list results get maximum row where for each status and row details as well.Like: No ID Name Status 4 1 D 1 7 2 G 3 Means latest entry for the status. Is there a way around, as I have tried all Max, Orderby descending but I get single result but I need a List as a result. 回答1: You have to extract the groups of a same id (GroupBy), and then export the max No