I have a List<> of objects in C# and I need a way to return those objects that are considered duplicates within the list. I do not need the Distinct resultset, I need a
public static IQueryable Duplicates(this IEnumerable source) where TSource : IComparable {
if (source == null) throw new ArgumentNullException("source"); return source.Where(x => source.Count(y=>y.Equals(x)) > 1).AsQueryable();
}