Hi, i am trying to obtain an item from a collection that occurs most frequently. if i were in SQL i would do something like this..
select top(1) extension from database.table
group by extension
order by count(extension) desc
but im trying to do this using linq.
Can someone assist with the translation?
so far i have this but its not working...
string topExtension = (from c in extensions select c).GroupBy(d => d).OrderByDescending(e => e.Count()).SingleOrDefault();