Suppose I have two lists:
foo1<T>
foo2<T>
each list has the property Id
that int
, I need to check if all the identifiers of the list are equal to the foo1
list foo2
, what I did:
foo1.Where(x => foo2.Any(z => z.Id != x.Id)).Any();
so if all values of Ids
each element are equal, should be returned false
if almost one another should return true
. Both lists are already ordered.
In fact, I get even true
, but it should return false
, because all my elements Ids
are equal.
What am I doing wrong?
Thank.
source
share