Posted on 15. October 2009 14:56 by B-Virtual
A collegue of mine needed an algorithm to filter out duplicate objects in a List and count the total occurence of each distinct object. He used this query to get his results, it may be usefull to some of you.
myRoles = from c in allRoles
group c.RoleId by new { c.PersonId, c.RoleTypeId }
into g
orderby g.Count() descending
select g;
Credits go to Roel Dieltjens
f2d8b58e-9b50-4f43-a5ab-3a06e2e4bf40|0|.0
Tags:
Development