Hi, I have a list List<T> instances
where T has a date variable and a string ID. Now I need the list to remove duplicates on the string ID and only keep the latest dates. Anyone know how?
I was thinking of creating a new list List<T> final
and looping through the instances list. In the loop checking if the list contains an item with the ID and then adding the item or removing the duplicate item with a lower date.
However I don't know how to check for a contains on a variable of a class T. Do I have to do this with lambda expression? or overwrite the Equals() of List? Forgot how to do either actually. Any help?
Or a better idea is always welcom to ofcourse!
Thanks a lot lot lot