How to find and remove duplicate objects in a collection using LINQ?
问题 I have a simple class representing an object. It has 5 properties (a date, 2 decimals, an integer and a string). I have a collection class, derived from CollectionBase , which is a container class for holding multiple objects from my first class. My question is, I want to remove duplicate objects (e.g. objects that have the same date, same decimals, same integers and same string). Is there a LINQ query I can write to find and remove duplicates? Or find them at the very least? 回答1: You can