Suppose these two strongly typed lists are:
List 1: existingitems
Identifier, name, cat
1, ABC, C
2, BCD, D
3, NNN, F
List 2: New Items
Identifier, name, cat
9, ABC, C
15, BCD, D
12, NNN, F
Basically, I want to check that the Name and Cat values are the same in both lists. If the two lists are identical in the two columns, return true, otherwise false.
I tried several options mostly around below, but it always seems to return true, even if there is a new line in the newbie list that I expect to return false.
newitems.Any(x1 => existingitems.All(x2 => (x1.Name== x2.Name) && (x1.Cat== x2.Cat)));
source
share