Checking whether relations are equal to foreign fields using LINQ Any() Can you find a more understandable way to write the following one-liner?

Enumerable.Range(0, relation.Fields.Count).
           Any(i =&gt; relation.Fields[i] != relation.ForeignFields[i])


but still preserving its brevity?

Simply put, I wanna cycle on relation.Fields collection to see if their string elements are one-by-one equal to relation.ForeignFields ones.

The reason I had to use Enumerable.Range is that I need an index, in order to cycle the two collections.

Note: they have for sure the same count.



I wrote an extension method based on @t3chb0t's answer
Can you not simply do SequenceEqual?

var list = new List&lt;string&gt; { "test1", "test2", "test3" };
var list2 = new List&lt;string&gt; { "test1", "test2", "test3" };

var areListsEqual = list.SequenceEqual(list2);