I have a collection of a class (List<EditGrid>). I am trying to find duplicates and found this online and it seemed pretty clean but I am getting an error:
Cannot convert type 'System.Collections.Generic.List<string>' to 'System.Collections.Generic.List<OrderManagement.EntityLayer.EditGrid>'
I tried this a couple of ways and got the same error.
Where is my generic List of string?
How can I get this to work?
Thanks,
Tom
Cannot convert type 'System.Collections.Generic.List<string>' to 'System.Collections.Generic.List<OrderManagement.EntityLayer.EditGrid>'
I tried this a couple of ways and got the same error.
Code:
List<EditGrid> duplicates = Selections.GroupBy(x => x.KTrace)
.Where(g => g.Count() > 1)
.Select(g => g.Key)
.ToList();
or
List<EditGrid> duplicates = (List<EditGrid>)Selections.GroupBy(x => x.KTrace)
.Where(g => g.Count() > 1)
.Select(g => g.Key)
.ToList();
Where is my generic List of string?
How can I get this to work?
Thanks,
Tom