I have this lambda expression:
if (!myList.Any( x => x.name == "example" && x.articleNumber == "1"))
{
}
else
{
}
myList contains an object from the class which has these properties: articleNumber, name and quantity.
And this enters in the if instead of in the else althought there is an object with name "example" AND articleNumber "1". Why does this happen?
myListmatch the predicate? If you think something should match, I'd check again. (The debugger will be your friend here and you can iterate through the list if you'd like)