Jamie King showing why groups are useful by counting the number of elements in a group.
Пікірлер: 4
@JamieKingCS11 жыл бұрын
Once you have your counts of the number of groups, you OrderByDescending() and then Take(howeverManyGroupsYouWant)
@ghostbusterz9 жыл бұрын
Is there a reason they made the LINQ query syntax require you to type "group c by " yet only require "orderby "? Because in method syntax they are typed the same (OrderBy & GroupBy). It seems unnecessary to have the c between "group" and "by" as it is isn't needed with "orderby".
@ianpaulbudiman519611 жыл бұрын
But how about if we want to just display the most country(ies) which has the most customers without to mentioned the number of the customers. Example: USA and UK both have 50 customers, so based on the grouping we made we wanna just display: USA, UK