Linq/C#: Selecting and summing items from the result of a group by?
- by Andrew White
Hi,
I have a list like this:
City Total
Sydney 11
Dublin 9
London 12
Dublin 3
London 9
Sydney 12
I first of all need to Group By City & Sum Total so I have
Sydney 23
Dublin 12
London 21
Next I need to filter for those that entries where the total is 20
Sydney 23
London 21
And what I finally need is the total of these entries, e.g. 44
I really want to do it in 1 single LINQ statement, possible?
Thx,