My code
query1 = select value1, value2 from dbo.animal where animalname="tiger";
query2 = select value1, value2 from dbo.animal where animalname="lion";
List<Animal> list1 = db.ExecuteStoreQuery<Animal>(query1).ToList();
List<Animal> list2 = db.ExecuteStoreQuery<Animal>(query2).ToList();
// list1.Count = 1 list1[0].value1 = "a" list1[0].value2 = "b"
// list2.Count = 1 list2[0].value1 = "a" list2[0].value2 = "b"
// Now I would like to compare list1 and list2 to see if they are equal
var list3 = list1.Except(list2);
//At this point list3 is containing both list1 and list2 and using var made it
//GenericList not the same type of list as List1 and List2
I tried List list3 = list1.Except(list2) but I get compile error.
So the question is how do I find out if list1 is equal to list2? I was hoping list3 would be the differences between list1 and list2 and therefore if the lists are equal list3.count() should be 0.
The nice thing about my data is I believe data in from query1 and query should be both in order and result in only 1 record each.