I have a List of my Objects with many Properties.
Dim Duplicates As New List(Of ElementObject) Dim ListOfDuplicates As New List(Of List(Of ElementObject)) For Each Element As ElementObject In Duplicates Dim tmpList As List(Of ElementObject) 'Im looking for list of elements with the same width and height in Duplicates list tmpList = Duplicates.FindAll(Function(x) x.Width = Element.Width And x.Height = Element.Height) tmpList = tmpLista.OrderBy(Function(x) x.Id).ToList() 'Here is what I want: I want to look if tmpLista is already in ListOfDuplicates, but this code does not work If ListOfDuplicates.Contains(tmpList) Then Continue For End If ListOfDuplicates.Add(tmpList) Next How can I achieve this, to check if List of my another List of Objects contains that list already?
tmpListaintmpList = tmpLista.OrderBy(Function(x) x.Id).ToList()appears to be a typo.Duplicates.GroupBy(...)