I want to find the item that occurs the most times in a table. So far I have:

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?


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!