We have below list of students where I we want to compare the two lists(source, destination), by comparing the student names. If student name is change then we need to execute update query, to update new student name.
Public Class Student
{
public int StudentId { get; set; }
public int StudentName { get; set; }
}
And we need to compare the student lists with source to destination.
IList<Student> studentList1 = new List<Student>() {
new Student() { StudentId = 1, StudentName = "John", Age = 18 } ,
new Student() { StudentId = 2, StudentName = "Steve", Age = 15 }
};
IList<Student> studentList2 = new List<Student>() {
new Student() { StudentId = 1, StudentName = "Michaiel", Age = 18 } ,
new Student() { StudentId = 2, StudentName = "Mike", Age = 15 } ,
};
So, as of now we were thinking to use SequenceEqual
method to compare two list. So, is this method also compares for case sensitive values and any other better alternative available to this ?
And this method can be used for other data type like boolean, int etc. ?
Any help on this appreciated !