I have a list of objects FilteredItems. Each item has a Property NewFileName. I want now a new list, so that I can act on each object where the NewFileName is not unique. (I want to change another property of those objects)
I started to write a Linq query, I am able to group them by their NewFileName, but I am unsure on how to continue now. How can I filter now those where the group count is > 1?
Or am I on the wrong path and there is a completely different solution to get the objects that have not a unique NewFileName?
var result = from files in FilteredItems
group files by files.newFileName;
foreach (var item in result) {
item.NewFileNameUnique = false;
}