The Distinct() function can be used to implement a unique LINQ operator. Only distinct (unique) components from the input sequence are included in the sequence that the Distinct() function returns. It operates by comparing the sequence's items for equality using the default equality comparer appropriate to each element's type.   For instance, you would use the Distinct() method as follows to return a sequence that only contains the unique integers from a list of integers:  List numbers = new List { 1, 2, 3, 4, 1, 2 };
IEnumerable uniqueNumbers = numbers.Distinct();  In this example, the uniqueNumbers sequence would contain the elements {1, 2, 3, 4}.  You can also pass in a custom equality compared to the Distinct() method if the default one does not work for your type.