I have a class called Item. Item has an identifier property called ItemCode which is a string. I would like to get a list of all non-distinct Items in a list of Items.
E
as an extension method:
public static IEnumerable NonDistinct (this IEnumerable source, Func keySelector) { return source.GroupBy(keySelector).Where(g => g.Count() > 1).SelectMany(r => r); }