I want to compare two lists, item by item. How can I express the following code using linq?
bool result = true;
var list1 = new List<int> { 10, 20, 30, 40 };
var list2 = new List<int> { 10, 20, 30, 40 };
for (int index = 0; index < list1.Count(); index++)
{
result &= list1[index] == list2[index];
}