function to check if all records are equal c# list code example
Example: check two lists are equal c#
List<int> list1 = new List<int> { 1, 2, 3 };
List<int> list2 = new List<int> { 1, 2, 3 };
if (list1.SequenceEqual(list2))
{
Console.WriteLine("true");
}
else
{
Console.WriteLine("false");
}