Aggregate
I want to find the item that occurs the most times in a table. So far I have:
But I get an error -
Is there a work-around or someway of getting the Aggregate operator?
UserSites.GroupBy(s => s.UserID).Aggregate((i1,i2) => i1.Count() > i2.Count() ? i1 : i2
)But I get an error -
NotSupportedException: The query operator 'Aggregate' is not supported.
Is there a work-around or someway of getting the Aggregate operator?
Comments
UserSites.GroupBy (s => s.UserID).OrderByDescending (i => i.Key).First()