Suppose I have two lists:
foo1<T>
foo2<T>
each list has the property Idthat int, I need to check if all the identifiers of the list are equal to the foo1list foo2, what I did:
foo1.Where(x => foo2.Any(z => z.Id != x.Id)).Any();
so if all values of Idseach element are equal, should be returned falseif 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 Idsare equal.
What am I doing wrong?
Thank.
source
share