I have a list of Objects, where every object has a “Name” and different other stuff. I want to filter out those objects who don’t have a unique name in that List.
Is there a LINQ Statement where I can “Union()” all the resulting groups and just return a IEnumerable of my objects?
Like
IEnumerable<MyObject> Results = (from x in Objects
group x by x.Name into g
where g.Count() > 1
select g)
.COMBINE_OR_WHATEVER();
Thanks!
Yes, there is. You can use
SelectMany.