I'm Linq noobie, maybe someone can point me in the right direction. What is wrong here? These anonymous types seem to have the same signature.
'*** Get all of the new list items'
Dim dsNewFiles = From l1 In list1 _
Where Not (From l2 In list2 _
Select l2.id, l2.timestamp).Contains(New With {l1.id, l1.timestamp})
I want in the above code there is some way to highlight, but I get a compilation error:
Value of type '<anonymous type> (line n)' cannot be converted to '<anonymous type> (line n)'.
under ".Contains ( New from {l1.id, l1.timestamp} )"
I suppose he thinks the anonymous types are somewhat different, but the id and timestamp columns are the same in any list. They are also in the same order. What else could be between the two?
[Edit 7/10/2009 16:28 EST]
Meta-Knight (New With {Key l1.id, l1.timestamp}), . , List1 List2 :
List1 List2
id timestamp id timestamp
-- ---------- -- ----------
01 2009-07-10 00:00:00 01 2009-07-10 00:00:00
:
dsNewFiles
id timestamp
-- ----------
01 2009-07-10 00:00:00
.