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
Here's a slightly different Linq solution that I think makes it more obvious what you're trying to do:
var s = from car in cars
group car by car.Color into g
where g.Count() == 1
select g.First();
It's just grouping cars by color, tossing out all the groups that have more than one element, and then putting the rest into the returned IEnumerable.