Currently I am working with something similar to the following:
if(listA.All(x => x.myHouseNumber == "1" || x.myValue == "2")
{
//do something
}
listA is a list of elements (myName, myHouseNumber, myStreet)
basically, I want the condition to be true if every myHouseNumber in listA is found in listB which is just a list of numbers
So if listA contains Bill,1,Main and Ted,2,Second and listB contains 1,2,3 the condition is true because 1 and 2 are found within list B. if listB contained 1,5,9 the condition would be false because 2 is missing.
I am having trouble understanding how to compare a list with a single item to a single element in a list with several items.
The end result I am hoping would be something like this which I cannot seem to get to work
if(listA.All(x => x.myHouseNumber.Contains(listB.Any())))
{
//do something
}
Hopefully someone will understand what I am going for and be able to provide some assistance
Thanks in advance!