I have a class Agent with a property Id
Given a collection of Agents I need to check if any of them have duplicate Ids.
I am currently doing this with a hash
this is how i would do it without the need to do group-by in one line:
List duplicates = new HashSet(agents.Where(c => agents.Count(x => x.ID == c.ID) > 1)).ToList();