I have a code in VB.NET that I need to find duplicate items in a list of Invoice, with same number (amounts could be different), here is what I got to do but is not working, I don’t know if I should use LINQ maybe… the database is in txt file.
Public Class Invoice
Public Property amount As Decimal
Public Property number As String
Public Property date As Date
'extracting information from txt file
Dim pesquisanotas As List(Of Invoice) = New NotaRepositorio().research()
‘part is not working, it is bringing invoices number with digits over 1 instead of repeated invoice numbers:
Dim DuplicateInvoice= From c In pesquisanotas
Where (c.number.Count > 1)
Select c
For Each item In DuplicateInvoice
MessageBox.Show(item.number)
Next
If the duplicates are already in the list, then this is how you can detect them: