I recently wrote a linq query to do a search in a list of items. Each item in my list contains 50 fields, now I have two lists, their set ups and fields are all the same. List A contains 100 records, List B contains 10000 records. What i need to do is using items in list a to search within List B to find its match.
That's simple enough and I manage to do that. however, If I increase my List B size to 100000 records, and using the same List A, the speed it does the job will be slower. Is there an efficient way of doing this other than what i did?
My linq query:
For Each pmTransaction In ListA
Dim tran As New Trans
tran = pmTransaction
Dim tranExist = (From tr As Trans In ListB Where _
tr.internref = tran.internref And tr.ledgerno = tran.ledgerno And _
tr.externref = tran.externref And _
tr.descriptn = tran.descriptn And _
tr.trantype = tran.trantype And tr.accountid = tran.accountid).FirstOrDefault